0

I am trying to set the configuration types for my CMakeLists.txt from the command line using the following call:

cmake .. -G "Visual Studio 14 2015 Win64" -T host=x64 -DCMAKE_CONFIGURATION_TYPES:STRING=Release -DCMAKE_INSTALL_PREFIX=C:\Temp -DCMAKE_PREFIX_PATH=C:\Temp\downloads 

But unfortunately it seems to be not recognized and configure step (try_compile) is done with Debug as default configuration.

I read the docs for CMAKE_CONFIGURATION_TYPES variable, searched the net but found no solution so far. What am I doing wrong or is it a known limitation?

Environment: CMake 3.11.0, Visual Studio 14 2015 (x86/x64), Visual Studio 15 2017 (x86/x64) Windows 10, Windows 7

2
  • What do you mean with "configure step is done with Debug as default coniguration"? Probably you need to set CMAKE_TRY_COMPILE_CONFIGURATION also. Commented May 4, 2018 at 7:59
  • That seems to be exactly the issue. I was not aware of this variable. If you make that an answer I will gladly accept it. Commented May 4, 2018 at 8:04

1 Answer 1

1

If you reduce the CMAKE_CONFIGURATION_TYPES to a single configuration, you probably need to also set CMAKE_TRY_COMPILE_CONFIGURATION:

cmake .. -G "Visual Studio 14 2015 Win64" -T host=x64 -D CMAKE_CONFIGURATION_TYPES:STRING=Release -D CMAKE_TRY_COMPILE_CONFIGURATION:STRING=Release -D CMAKE_INSTALL_PREFIX=C:\Temp -D CMAKE_PREFIX_PATH=C:\Temp\downloads 

References

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.