[CMake] Selecting DEBUG and RELEASE Builds in Linux

BlinkEye gentoo at blinkeye.ch
Tue Mar 4 08:18:48 EST 2008


On Tue, March 4, 2008 11:27, Malhotra, Anupam wrote:
> CMAKE_BUILD_TYPE is not initialized with a readable value at
> configuration time. This is because the user is free to select a build
> type at build time. Now in visual studio 6/visual studio 8 2005 we can
> select the build type by selecting Debug/Release after opening the
> workspace/solution. But how can the same be achieved in Linux? After my
> makefiles are generated using cmake, I want to first build the Debug
> mode and then the release mode. But how do I select which build type to
> select while building? Please advise.
>
Create a build directory containing both a debug and release dir like:

my_project/debug
my_project/release

enter my_project/debug and init the project like usual ( cmake path_to_my_project ).
execute

# make edit_cache

and change or set CMAKE_BUILD_TYPE to "Debug". hit [c], [e] and [g] to configure,
exit and generate appropriate makefiles and start building.

enter my_project/release and do the same steps except set CMAKE_BUILD_TYPE to
"Release".




More information about the CMake mailing list