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?
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With