[CMake] Install PDB files

Bo Thorsen bo at askmonty.org
Fri Jul 9 06:57:12 EDT 2010

Den 08-07-2010 21:56, Rolf Eike Beer skrev:
> Am Thursday 08 July 2010 schrieb Bo Thorsen:
>> Den 07-07-2010 19:43, Rolf Eike Beer skrev:
>>> Am Wednesday 07 July 2010 schrieb Patrick Spendrin:
>>>> we're currently thinking about setting up a symbol server for our
>>>> project, and cannot find out how to install the pdb file together with
>>>> the install command (or in another way).
>>>> Did somebody do this already? Is there only the way to fetch the pdb
>>>> files by hand?
>>> We have currently an ugly macro that searches for the PDB in all possible
>>> places (e.g. foo for NMake, foo/Release, foo/Debug, foo/RelWithDebInfo,
>>> and foo/MinSizeRel for MSVC) and installs them. To make a long story
>>> short: this sucks.
>> There are people who have written better macros for this. The idea is to
>> get the full path of a known target file - an exe for example - and
>> replace the filename on it. Try googling for this, I don't have a link
>> at hand.
> Yes, that's also in the macro. I haven't written it, but IIRC there were
> problems with CMAKE_RUNTIME_OUTPUT_DIRECTORY, different MSVC versions, NMake or
> GUI and whatnot. Anyway, I still tend to see that as crap. IMHO there should
> be a simple way to get the location of those files or better providing a simple
> version to install them.
>>> When someone adds this please keep in mind that gcc also has the
>>> possibility to strip the debugging symbols of an object to a different
>>> file. This should be taken care of here, too.
>> I doubt that's a problem with .pdb files :)
> Of course, but when we have a function to get those debug symbols for more
> than one compiler that would be of general use.
>>> I propose an option to the install command, something like:
>>>     ARCHIVE lib
>>>     RUNTIME bin
>>>     LIBRARY lib
>>>     DEBUG_SYMBOLS dbg
>>> )
>> Then you have people who want .map files, .exp files etc. You can't make
>> a positive list and solve the actual problem.
>> I have a bug report with this particular problem here:
>> http://www.cmake.org/Bug/view.php?id=10940
> Ehm, that one doen't look very related or do I miss something?

It should be exactly what you want, but maybe I didn't explain it 
properly in the bug report. With my suggestion, you could write

INSTALL(FILES ${CPACK_BUILD_DIR}/targetname.pdb ...)

I don't believe in the suggestion to add a special DEBUG target on the 
INSTALL(TARGET .. command, as others will need other files, and they 
can't all be covered. A generic solution is needed instead.

Bo Thorsen.
Monty Program AB.


MariaDB: MySQL replacement
Community developed. Feature enhanced. Backward compatible.

More information about the CMake mailing list