Creating symbol table for gdb using cmake

Add this line to the file CMakeLists.txt:

set(CMAKE_BUILD_TYPE Debug)

compile in Release mode optimized but adding debug symbols, useful for profiling :

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ...

or compile with NO optimization and adding debug symbols :

cmake -DCMAKE_BUILD_TYPE=Debug ...