CMAKE_CONFIGURATION_TYPES considered harmful

Alexander Neundorf neundorf at kde.org
Thu Nov 6 00:25:39 CET 2008


On Wednesday 05 November 2008, Brad King wrote:
> Manuel "Sput" Nickschas wrote:
...
> > While in theory and according to cmake docs this should just add the
> > additional build configuration to a list of existing ones, in reality
> > this adds "Debugfull" to an empty list, since CMake does not set this
> > variable (anymore? Dunno if that was always the case...). This results in
> > CMake always installing Debugfull, since it's set to be the only valid
> > type.
>
> The variable is used by the IDE generators like VS and Xcode which have
> multiple configurations in a single build tree.  It should not be set
> for Makefile generators.

So you would recommend checking the generator over setting 
CMAKE_CONFIGURATION_TYPES to CMAKE_BUILD_TYPE initially ?

This is what I was about to do:

if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
   set(CMAKE_BUILD_TYPE RelWithDebInfo)
   set(CMAKE_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES}  
                                 ${CMAKE_BUILD_TYPE} )
endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)

Alex


More information about the Kde-buildsystem mailing list