Tuesday, August 12, 2008

ccmake -g





If you have a CMake project in C++ and want to compile with debugging flags, often you can just set the "CMAKE_DEBUG" flag in ccmake to "ON". Sometimes this isn't set up in the project you're working on, so you could also:


export CMAKE_CXX_FLAGS=-g


or


ccmake -DCMAKE_CXX_FLAGS=-g


or


ccmake


press "t" (to toggle the advanced mode)
and set the options you want by hand.


Another useful tidbit with CMake is that if you:


make VERBOSE=1


ccmake will show you the full command line that it is using to compile.



Thanks Graham!