I just created 6 or 7 new configurations for VS2008 with cmake 2.8.4 (now it's days or even hours since version 2.8.5) for a simple hi-world project.
The reason why your attemps failed what flags are inccorect eg they must be /MDd no -MDd You notation will work for GCC based compilers, not for VS.
I recommend that you set the closest flags and change them, and then
set(CMAKE_CXX_FLAGS_FOO ${CMAKE_CXX_FLAGS_DEBUG})
I also noticed that sometimes cmake doesnβt actually write to .sln, or it does not always reboot (well, I am running win7 on VirualBox, maybe this is the source of the problems).
I did the following:
file(GLOB WILL_REMOVE "${CMAKE_CURRENT_BINARY_DIR}/*.vcproj") execute_process(COMMAND ${CMAKE_COMMAND} -E remove -f ${WILL_REMOVE}) file(GLOB WILL_REMOVE "${CMAKE_CURRENT_BINARY_DIR}/*.sln") execute_process(COMMAND ${CMAKE_COMMAND} -E remove -f ${WILL_REMOVE}) file(GLOB WILL_REMOVE "${CMAKE_CURRENT_BINARY_DIR}/*.user") execute_process(COMMAND ${CMAKE_COMMAND} -E remove -f ${WILL_REMOVE})
at least it reloads files :)
however, sometimes I need to run cmake 2 or 3 times to see the new configuration in visual studio (maybe a virtual box, cmake, or a visual studio error - they have no idea about this).
But, in any case, after 2 or 3
cmake ..
It works!!!!
source share