[CMake] Adding .pdb files to CPack (Visual Studio 7 generator)

Torsten Martinsen tma at gatehouse.dk
Fri Oct 12 09:40:02 EDT 2007


Torsten Martinsen <> wrote:

> Hendrik Sattler <> wrote:
>
>> Did you try using the LOCATION property of the TARGET stripping the
>> extension and using that?
>
> Not until now, but: The LOCATION property expands to e.g.
> "C:/user/gh/ais/impl/build/cmake/vc7/ca/$(OutDir)/ca.exe", so that is
> also no good.

For future reference, I ended up with this solution:

   # First, build the full name of the EXE.
   INSTALL(CODE "SET(PDB_FULL_PATH
${CMAKE_CURRENT_BINARY_DIR}/\${${project}_BUILD_NAME_\${CMAKE_INSTALL_CO
NFIG_NAME}})")
   # Then, replace .exe with .pdb.
   INSTALL(CODE "STRING(REPLACE .exe .pdb PDB_FULL_PATH
\${PDB_FULL_PATH})")
   # Finally, get it installed.
   INSTALL(CODE "FILE(INSTALL DESTINATION
\"\${CMAKE_INSTALL_PREFIX}/\${CMAKE_INSTALL_CONFIG_NAME}\" TYPE
EXECUTABLE FILES \${PDB_FULL_PATH})")

The trick is to postpone evaluation of the CPack variables until CPack
runs. Not pretty, but it works.

-Torsten

This e-mail and any files sent with it contain information that may be privileged or confidential and is the property of the GateHouse Group. This information is intended solely for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use the message or any part thereof. If you have received this e-mail in error, please notify the sender immediately, and delete all copies of this message. In accordance with GateHouse Security Policy, e-mails sent or received may be monitored.


More information about the CMake mailing list