[CMake] Find out which build type is currently used

norulez norulez at me.com
Thu Jul 22 03:55:49 EDT 2010


I want to set the debug prefix on windows when I build in debug mode, so I check if Debug is in CMAKE_BUILD_TYPE.
I use both, Visual Studio and the MinGW compiler

Am 22.07.2010 um 08:53 schrieb Michael Wild <themiwi at gmail.com>:

> 
> On 22. Jul, 2010, at 8:38 , norulez wrote:
> 
>> How can I find out which build type is used? Because if I didn't define CMAKE_BUILD_TYPE, this variable is uninitialized.
> 
> That depends. For single-configuration generators (i.e. Makefile based), the user has to set CMAKE_BUILD_TYPE. If it is empty, no special configuration options will be used. For multi-configuration generators (VisualStudio, Xcode, etc.), you simply can't know at CMake-time, since the user can change the selection before hitting the build button.
> 
> What is it that you want to achieve? Probably there's a better way...
> 
> Michael
> 


More information about the CMake mailing list