MantisBT - CMake
View Issue Details
0013644CMakeCMakepublic2012-11-02 10:492013-04-17 08:54
Reid Kleckner 
Brad King 
normalminoralways
closedfixed 
Windows
CMake 2.8.10 
CMake 2.8.10.1CMake 2.8.10.1 
0013644: Default pdb output location changed in cmake 2.8.10
In the course of adding PDB_OUTPUT_DIRECTORY and related properties and variables, the default location for pdb files changed.

In our project (DynamoRIO) we have a bunch of targets where we set RUNTIME_OUTPUT_DIRECTORY, LIBRARY_OUTPUT_DIRECTORY, etc. The .pdb file would get created in ${RUNTIME_OUTPUT_DIRECTORY} next to the .dll, which is what we want. After this change, it would get created in the default output directory, which is different. Furthermore, this would mean the pdbs never got installed.

Our CMake code:
set_target_properties(dynamorio PROPERTIES
  LIBRARY_OUTPUT_DIRECTORY${location_suffix} "${DR_LIBRARY_OUTPUT_DIRECTORY}"
  RUNTIME_OUTPUT_DIRECTORY${location_suffix} "${DR_LIBRARY_OUTPUT_DIRECTORY}"
  ARCHIVE_OUTPUT_DIRECTORY${location_suffix} "${DR_LIBRARY_OUTPUT_DIRECTORY}"
  # The next line is the one I added to work around the problem.
  #PDB_OUTPUT_DIRECTORY${location_suffix} "${DR_LIBRARY_OUTPUT_DIRECTORY}"
  )

From the linker command line:
/out:lib32\debug\dynamorio.dll
/implib:lib32\debug\dynamorio.lib
/pdb:core\dynamorio.pdb

We can easily work around the problem by setting PDB_OUTPUT_DIRECTORY as well as RUNTIME, ARCHIVE, and LIBRARY, but it'd be nice for other users that aren't using cmake from version control if the default didn't change.

Upstream issue where we figured this out:
http://code.google.com/p/chromium/issues/detail?id=159092 [^]

Original issue:
http://www.cmake.org/Bug/view.php?id=10830 [^]

CMake commit that made the change:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f60dbf1 [^]
1. Create a library target
2. Set the runtime and archive output directory to somewhere non-default
3. Build it
4. Observe that the pdb does not reside next to the dll
No tags attached.
patch 0001-Fix-default-PDB-output-directory-13644.patch (3,035) 2012-11-02 12:54
https://public.kitware.com/Bug/file/4550/0001-Fix-default-PDB-output-directory-13644.patch
Issue History
2012-11-02 10:49Reid KlecknerNew Issue
2012-11-02 12:54Brad KingFile Added: 0001-Fix-default-PDB-output-directory-13644.patch
2012-11-02 12:54Brad KingAssigned To => Brad King
2012-11-02 12:54Brad KingStatusnew => assigned
2012-11-02 12:54Brad KingNote Added: 0031384
2012-11-02 15:50Reid KlecknerNote Added: 0031388
2012-11-05 08:53Brad KingNote Added: 0031425
2012-11-05 08:53Brad KingStatusassigned => resolved
2012-11-05 08:53Brad KingResolutionopen => fixed
2012-11-06 15:18David ColeTarget Version => CMake 2.8.10.1
2012-11-07 13:36David ColeFixed in Version => CMake 2.8.10.1
2013-04-17 08:54Robert MaynardNote Added: 0032864
2013-04-17 08:54Robert MaynardStatusresolved => closed

Notes
(0031384)
Brad King   
2012-11-02 12:54   
Please try attached "0001-Fix-default-PDB-output-directory-13644.patch" on top of 2.8.10.
(0031388)
Reid Kleckner   
2012-11-02 15:50   
Thanks! That appears to work. When I build our package without any local PDB_OUTPUT_DIRECTORY changes the pdbs end up getting installed.
(0031425)
Brad King   
2012-11-05 08:53   
Thanks for testing. Applied:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f3093668 [^]
(0032864)
Robert Maynard   
2013-04-17 08:54   
Closing resolved issues that have not been updated in more than 4 months.