Cmake: can't get rid of minSizeRel

By default, VS projects created by CMake have the following build configurations:

  • Debug
  • Release
  • MinSizeRelease
  • RelWithDebInfo

I don't need the MinSizeRelease config, all I want is Debug and ReleaseWithDebInfo. So after reading the FAQ ( http://www.cmake.org/Wiki/CMake_FAQ ) I tried

message("value of CMAKE_CONFIGURATION_TYPES before: ${CMAKE_CONFIGURATION_TYPES}")

if(CMAKE_CONFIGURATION_TYPES)      
  set(CMAKE_CONFIGURATION_TYPES Debug RelWithDebInfo)
  set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Reset the configurations to what we need" FORCE)
endif()

message("value of CMAKE_CONFIGURATION_TYPES after: ${CMAKE_CONFIGURATION_TYPES}")

project("sys_utils_tests")

      

output:

value of CMAKE_CONFIGURATION_TYPES before: Debug;Release;MinSizeRel;RelWithDebInfo
value of CMAKE_CONFIGURATION_TYPES after: Debug;RelWithDebInfo

      

However, when I open the generated projects, I still see Debug; Release; MinSizeRel; RelWithDebInfo. What's wrong?

+3


source to share





All Articles