I want to change the pdb symbol file path according to this doc
and set /PDBALTPATH:%_PDB%
. However, if I write
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG
/OPT:REF /OPT:ICF /PDBALTPATH:%_PDB%")
and check the result in the project properties, it reads /PDBALTPATH:%%_PDB%%
.
Leaving the percent signs out results in /PDBALTPATH:_PDB
.
How do I achieve /PDBALTPATH:%_PDB%
?
Patterns I've tried so far (all of them turn a % into %% ):
/PDBALTPATH:%_PDB%
/PDBALTPATH:_PDB
/PDBALTPATH:%25_PDB%25
/PDBALTPATH:%%_PDB%%
Since CMake 3.1 there is a
TARGET_PDB_FILE_NAME
generator expression (doc). It evaluates just to the name of the file, without the path.So, you can achieve the effect of
%_PDB%
by replacing it with the actual name of the pdb file at generation-time. You'll need to specify the linker flags for each target of interest, though.The command will be like so