[Cmake] Adding debug flags, what am I doing wrong?

Brad King brad.king at kitware.com
Thu Jul 22 15:08:53 EDT 2004


Jorgen Bodde wrote:
> Hi List,
> 
> I want to add a couple of flags to the debug make flags. This is what I do:
> 
> SET ( CMAKE_CXX_FLAGS_DEBUG [INTERNAL] -D__WXDEBUG__ -DWXDEBUG=1 )
> 
> Nothing gets added. Nothing gets changed after configure. Without 
> [INTERNAL] (if that even is correct) I don't see anything either. I 
> press "Configure" after I deleted the cache until everything is gray, 
> and the debug flags always list "/MDd /Zi /Od /GZ"
> 
> I am aware that this will overwrite the old flags, but even that doesn't 
> work. What am I doing wrong here?

The cache variables listed in the GUI when you press "configure" are 
used to initialize the values seen by the cmake listfile code.  Changes 
made by the code are seen by the generators but are not stored back into 
the cache.  What you probably want is this:

SET(CMAKE_CXX_FLAGS_DEBUG
     "${CMAKE_CXX_FLAGS_DEBUG} -D__WXDEBUG__ -DWXDEBUG=1")

The flags will not appear in the GUI but will be included in the build.

-Brad


More information about the Cmake mailing list