[CMake] Save stripped debugging information

Rolf Eike Beer eike at sf-mail.de
Thu Sep 22 03:37:36 EDT 2011


> Hi,
>
> I'm aware of the option CMAKE_BUILD_TYPE with which I can tell if I
> want to include debugging information or not.
>
> A very useful feature of the program objcopy is, to not strip
> debugging information from a file but to split it from it so that you
> can release a program without debugging information but can later
> debug it if you put the split debugging files in certain directories
> (more at
> http://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html).
>
> Is there a CMake way to do this?

Sadly not. This is also annoying for e.g. MSVC builds where the debug
infos are stored in an extra file (.pdb) anyway, but you have no good way
to know the current location of the pdb file to install it.

I would like to see this as a fourth option to INSTALL(TARGETS):

INSTALL(TARGETS myexe mylib DEBUG_SYMBOLS /foo)

This could just copy the pdb file on MSVC builds and do the objcopy magic
in Un*x builds.

Eike


More information about the CMake mailing list