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

Kermit Mei kermit.mei at gmail.com
Fri Dec 19 05:42:45 EST 2008


Werner Smekal wrote:
> 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
>
It works well.
Thank you for your help;p


More information about the CMake mailing list