MantisBT - CMake
View Issue Details
0006788CMakeCMakepublic2008-04-10 05:422008-08-19 14:43
jesperes 
 
normalminoralways
closedno change required 
CMake-2-6 
 
0006788: CMAKE_CONFIGURATION_TYPES cannot be set in CMakeLists.txt without rerunning cmake.
Visual Studio generator requires the value of CMAKE_CONFIGURATION_TYPES to be present in cache when CMake runs; it is not possible to set CMAKE_CONFIGURATION_TYPES in CMakeLists.txt (without rerunning CMake). Example:

project(foo)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release;FooBar" CACHE STRING "" FORCE)
add_executable(foo foo.c)

Running "cmake" once to generate project files will not cause the "FooBar" configuration to be included.

Running "cmake" again, or specifying the value on the command line, works.
No tags attached.
Issue History
2008-04-10 05:42jesperesNew Issue
2008-08-19 14:43Bill HoffmanStatusnew => closed
2008-08-19 14:43Bill HoffmanNote Added: 0013072
2008-08-19 14:43Bill HoffmanResolutionopen => no change required

Notes
(0013072)
Bill Hoffman   
2008-08-19 14:43   
You just need to move the set before the project command:

set(CMAKE_CONFIGURATION_TYPES "Debug;Release;FooBar" CACHE STRING "" FORCE)
project(foo)