CMAKE_CONFIGURATION_TYPES considered harmful

Brad King brad.king at kitware.com
Wed Nov 5 23:57:46 CET 2008


Manuel "Sput" Nickschas wrote:
> Hi guys,
> 
> we at Gentoo have recently discovered that KDE's packages always use the 
> Debugfull configuration for installation:
> 
> -- Install configuration: "Debugfull"
> 
> This happens also if CMAKE_BUILD_TYPE="Release". We have hunted down that 
> issue and traced it back to FindKDE4Internal.cmake line 1033:
> 
> set (CMAKE_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES} "Debugfull")

That should be more like

if(CMAKE_CONFIGURATION_TYPES)
  list(APPEND CMAKE_CONFIGURATION_TYPES Debugfull)
endif(CMAKE_CONFIGURATION_TYPES)

> 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.

-Brad


More information about the Kde-buildsystem mailing list