Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
205 views
in Technique[技术] by (71.8m points)

CMake output path for compile pdb files

I'm trying to specify the output path for program database (pdb) files of static libraries in CMake. I think CMake calls them compile pdbs, as opposed to linker pdbs.

From CMake's documentation I found out that I can specify the pdb output directory by COMPILE_PDB_OUTPUT_DIRECTORY. That works as expected. I can also specify the name of the pdb file by COMPILE_PDB_NAME. That also works as expected. However, I am getting an extraneous configuration string appended between the directory and the name, which does not seem to be controlled by either of the previous two. That is, the final output path is of the form C:mypdboutputpathRelWithDebInfomypdbname.pdb, where RelWithDebInfo corresponds to the current configuration. However, my outputpath already contains my own configuration specifier (my library output directory is of the form libmsvc64-relwithdebinfo). I've been trying to set both global and target-specific pdb-names and directories, but they do not affect whether the configuration-string is appended or not.

How to get rid of the appended configuration string in the pdb output path?

Although Visual Studio is multi-configuration, my approach is to use CMake as if it were single-configuration, i.e. the configuration is chosen when running CMake.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share

1.2m questions

2.1m answers

5 comments

56.5k users

...