Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PDB files with CMake install

I am using a CMake command to install PDB files to enable debugging in a developer distribution of my C++ application. The command is as below:

INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/Debug
    DESTINATION bin
    FILES_MATCHING
    PATTERN *.pdb
)

Also, I've managed to install the relevant source used to build that developer distribution, in a 'src' folder at the same level, so that my top level distribution folder looks as:

include\
src\
lib\
bin\
share\
doc\
3rdparty\
etc\

How can I let the PDB files 'know' where the source is (I am assuming this is required)? Is there a CMake command that can achieve this? What would be a small example?

like image 790
squashed.bugaboo Avatar asked Feb 18 '13 22:02

squashed.bugaboo


1 Answers

I just answered my own similar question, How to get CMake to install PDB files for targets.

Use this install rule to copy the target's PDB file, if it exists, to the target's install location bin directory.

install(FILES $<TARGET_PDB_FILE:${PROJECT_NAME}> DESTINATION bin OPTIONAL)
like image 59
Phil Avatar answered Oct 05 '22 21:10

Phil