Enable debugging with cmake

How to enable debugging with cmake?
asked Jan 21, 2013 by anonymous

1 Answer

 
Best answer

If we use cmake to build the project, we may want to enabling the debuging mode that cmake invoke gcc with the -g so that we can debug the compiled program with gdb.

This can be enabled by adding the CMAKE_BUILD_TYPE parameter to cmake:

cmake -DCMAKE_BUILD_TYPE=Debug .

Then the compiled program can be debugged with gdb.

answered Jan 21, 2013 by anonymous

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...