[CMake] Find out which build type is currently used

Michael Wild themiwi at gmail.com
Thu Jul 22 02:53:52 EDT 2010


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