On 28. Jun, 2010, at 15:17 , Mark Van Peteghem wrote:

> Hi,
> 
> I am using CMake to generate Visual Studio project files, later also for
> CodeBlocks.
> 
> It seems that CMake generates four different configurations for Visual
> Studio: Debug, Release, MinSizeRel and RelWithDebInfo. However, I need other
> configuations, Debug and Release, both for Win32 and MX3, in one project
> file. How do I change this?
> 
> I tried this by changing *CMAKE_CONFIGURATION_TYPES *and CMAKE_BUILD_TYPES,
> e.g.
> 
> SET(CMAKE_BUILD_TYPES Debug Release DebugMX31 ReleaseMX31)
> 
> but I have the impression that these variables cannot be changed.
> 
> -- 
> Mark

You have to change CMAKE_CONFIGURATION_TYPES in the cache. Here is some 
template I use:

# Xcode generator is buggy (linker flags are not inherited from compile flags
# and custom configurations don't work with shared libraries)
if(NOT CMAKE_GENERATOR STREQUAL Xcode)
  set(CMAKE_C_FLAGS_SUPERDUPER "--super --duper" CACHE
    STRING "Flags used by the compiler during super-duper builds")
  set(CMAKE_EXE_LINKER_FLAGS_SUPERDUPER "--super --duper" CACHE
    STRING "Flags used by the linker for executables during super-duper builds")
  set(CMAKE_SHARED_LINKER_FLAGS_SUPERDUPER "--super --duper" CACHE
    STRING "Flags used by the linker for shared libraries during super-duper 
builds")
  set(CMAKE_MODULE_LINKER_FLAGS_SUPERDUPER "--super --duper" CACHE
    STRING "Flags used by the linker for loadable modules during super-duper 
builds")
  mark_as_advanced(CMAKE_C_FLAGS_COVERAGE CMAKE_EXE_LINKER_FLAGS_SUPERDUPER
    CMAKE_SHARED_LINKER_FLAGS_SUPERDUPER CMAKE_MODULE_LINKER_FLAGS_SUPERDUPER)
  # This variable is only set for multi-config IDE generators
  if(CMAKE_CONFIGURATION_TYPES)
    list(APPEND CMAKE_CONFIGURATION_TYPES SuperDuper)
    list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
    set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
      "Semicolon separated list of supported configuration types 
[Debug|Release|MinSizeRel|RelWithDebInfo|SuperDuper]"
      FORCE)
  endif()
endif()

HTH

Michael

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to