[CMake] Missing CMAKE_CONFIGURATION_TYPES with project NONE on Windows

Paul Smith paul at mad-scientist.net
Fri May 10 10:31:53 EDT 2013


Hi all.  I'm using cmake 2.8.10.2.  I'm trying to introduce an
alternative compiler into my build system for Linux, so as a first step
I've separated my project statement from:

  project(MyProject C CXX)

into:

  project(MyProject NONE)
  enable_language(C)
  enable_language(CXX)

This works fine on Linux (makefile generator) and MacOSX (XCode
generator): cmake and build and test work.  But on Windows (VS 10 Win64
generator) cmake succeeds, but running the resulting project file does
not work: it fails immediately.  Looking at the CMakeCache.txt file I
can see that two of the default CMAKE_CONFIGURATION_TYPES settings are
missing; the cached value from before I made the above change is:

  CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo

and after the above change it's:

  CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release

The failure happens because our default build type is RelWithDebInfo
which of course doesn't exist.

I didn't change anything else and we don't set this variable anywhere in
our cmake files.

I guess I can go in and set this by hand, but anyone have any ideas why
it disappeared, and if this is a bug?



More information about the CMake mailing list