[CMake] How can I add -gstabs to the compile item for Debug?

Werner Smekal smekal at iap.tuwien.ac.at
Fri Dec 19 03:12:42 EST 2008


Hi,
>
> cmake -DCMAKE_CXX_FLAGS_DEBUG="-g" CMAKE_INSTALL_PREFIX=/usr ..
>
> But the result is:
>
> This GDB was configured as "i486-linux-gnu"...
> (gdb) b main
> Breakpoint 1 at 0x80487b3
> (gdb) r
> Starting program: /home/kermit/Project/FreeRecite/build/bin/ 
> FreeRecite-core
>
> Breakpoint 1, 0x080487b3 in main ()
> Current language:  auto; currently asm
> (gdb) n
> Single stepping until exit from function main,

Does it help if you use

cmake -DCMAKE_BUILD_TYPE=Debug CMAKE_INSTALL_PREFIX=/usr ..

which actually sets the debug flag (-g) automatically?

Regards,
Werner


More information about the CMake mailing list