[CMake] Cannot compile in debug mode

Bogdan Cristea cristeab at gmail.com
Sun Jun 10 11:39:58 EDT 2012


Hi

I have a project containing a subfolder, src. Both, the main folder and the 
subfolder, contain CMakeLists.txt files. In the CMakeLists.txt of the main 
folder contains the following code

IF ("Debug" STREQUAL "${CMAKE_BUILD_TYPE}")
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_DEBUG_ENABLE_LOG -ggdb" )
ENDIF()

However, when compiling with 'make VERBOSE=1' I notice that the first compile 
options are mine, but then follows '-O2 -g' which are somehow set by cmake and 
don't allow me to compile in the debug mode. Can anyone explain why this 
happens ?

-- 
Bogdan


More information about the CMake mailing list