View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014600CMakeCMakepublic2013-11-26 20:222014-10-06 10:32
ReporterCharles Karney 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 2.8.12 
Target VersionCMake 3.0Fixed in VersionCMake 3.0 
Summary0014600: Document PDB behavior w.r.t. static libraries
DescriptionI'm building using cmake 2.8.11 with the Visual Studio 10 Generator and
src/CMakeLists.txt contains

  set_target_properties (${PROJECT_STATIC_LIBRARIES} PROPERTIES
      VERSION "${LIBVERSIONFULL}" OUTPUT_NAME GeographicLib
      PDB_NAME GeographicLib_STATIC)

After building I have

  <build-dir>/src/DEBUG/GeographicLib_STATIC.pdb

alongside my .lib file as expected. (Actually it's
geographiclib_static.pdb, but never mind about that.)

A colleague is using cmake 2.8.12 with my project and for him the pdb
file is buried as

  <build-dir>/src/GeographicLib_STATIC.dir/Dedug/vc100.pdb

I.e., the directory and the name are wrong. This bug was introduced
between 2.8.11 and 2.8.12. The following deletion seems to be
responsible.

--- cmake-2.8.11/Source/cmVisualStudio10TargetGenerator.cxx 2013-05-15 13:38:13.000000000 -0400
+++ cmake-2.8.12/Source/cmVisualStudio10TargetGenerator.cxx 2013-10-07 11:31:00.000000000 -0400
@@ -1260,18 +1409,7 @@
 
   clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
                                           "\n", "CXX");
- this->WriteString("<AssemblerListingLocation>", 3);
- *this->BuildFileStream << configName
- << "</AssemblerListingLocation>\n";
   this->WriteString("<ObjectFileName>$(IntDir)</ObjectFileName>\n", 3);
- if(this->Target->GetType() != cmTarget::OBJECT_LIBRARY)
- {
- this->WriteString("<ProgramDataBaseFileName>", 3);
- *this->BuildFileStream << this->Target->GetPDBDirectory(configName.c_str())
- << "/"
- << this->Target->GetPDBName(configName.c_str())
- << "</ProgramDataBaseFileName>\n";
- }
   this->WriteString("</ClCompile>\n", 2);
 }
 
Steps To ReproduceSet the PDB_NAME property on a library, build the Debug config. PDB file is
in the right location with 2.8.11 and in the wrong location with 2.8.12.
TagsNo tags attached.
Attached Files

 Relationships
related to 0011899closedBrad King Put compiler's program database files into intermediate directory rather than output one for VS 2005 
related to 0014062closedBrad King Setting Compiler and Linker PDB to the same path in Visual Studio is unsupported. 
related to 0014577closedBrad King Need to map /Fd to ProgramDataBaseFileName in VS 7,8,9 
related to 0014763closedBrad King Add target properties to specify MS compiler PDB files 

  Notes
(0034576)
Charles Karney (reporter)
2013-11-26 20:56

To reproduce:

git clone git://git.code.sf.net/p/geographiclib/code [^] geographiclib
cd geographiclib
git checkout d3deb4d003ed87878f649e9f2f18e8af73edaa86
mkdir BUILD
cd BUILD
cmake -G 'Visual Studio 10' -D CMAKE_INSTALL_PREFIX=wherever ..
cmake --build . --config Debug
cmake --build . --config Debug --target INSTALL

PDB files are correctly installed with cmake 2.8.11. The install gives
an error with 2.8.12:

CMake Error at src/cmake_install.cmake:44 (FILE):
  file INSTALL cannot find
  "C:/jenkins/workspace/geographiclib-win7-agc/geographiclib-build/win7/geographiclib/src/DEBUG/GeographicLib_STATIC.pdb".
Call Stack (most recent call first):
  cmake_install.cmake:41 (INCLUDE)
(0034587)
Brad King (manager)
2013-11-27 10:31

See this commit:

 VS: Separate compiler and linker PDB files
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=42ba1b08 [^]

addressing issue 0014062.
(0034588)
Brad King (manager)
2013-11-27 10:32

See also discussion in 0014577.
(0034623)
Charles Karney (reporter)
2013-12-02 07:48

So bottom line is that this isn't a bug because PDB files for static libraries are not supported (and maybe even meaningless)? I'm fine with this outcome and only suggest that the documentation make this restriction more explicit.
(0034679)
Brad King (manager)
2013-12-02 12:08

Re 0014600:0034623: The commit linked in 0014600:0034587 updated the PDB_NAME and PDB_OUTPUT_DIRECTORY documentation to say that they are only for linker-generated .pdb files for executables and shared libraries. However, I agree the new wording does not stand out much when not looking at that diff.

I've made some documentation updates:

Help: Document CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG> variable
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cb7b9072 [^]

Help: Format PDB_NAME and PDB_OUTPUT_DIRECTORY documentation
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09c05f37 [^]

Help: Document PDB behavior w.r.t. static libraries explicitly
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c0897cfa [^]
(0036909)
Robert Maynard (manager)
2014-10-06 10:32

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-11-26 20:22 Charles Karney New Issue
2013-11-26 20:56 Charles Karney Note Added: 0034576
2013-11-27 10:29 Brad King Relationship added related to 0011899
2013-11-27 10:29 Brad King Relationship added related to 0014062
2013-11-27 10:31 Brad King Note Added: 0034587
2013-11-27 10:31 Brad King Relationship added related to 0014577
2013-11-27 10:32 Brad King Note Added: 0034588
2013-12-02 07:48 Charles Karney Note Added: 0034623
2013-12-02 12:08 Brad King Note Added: 0034679
2013-12-02 12:10 Brad King Assigned To => Brad King
2013-12-02 12:10 Brad King Status new => resolved
2013-12-02 12:10 Brad King Resolution open => fixed
2013-12-02 12:10 Brad King Fixed in Version => CMake 3.0
2013-12-02 12:10 Brad King Target Version => CMake 3.0
2013-12-02 12:10 Brad King Summary PDB_NAME target property ignored => Document PDB behavior w.r.t. static libraries
2014-02-18 09:59 Brad King Relationship added related to 0014763
2014-10-06 10:32 Robert Maynard Note Added: 0036909
2014-10-06 10:32 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team