Browse Source

Merge pull request #2458 from jackoalan/pdb-install-fix

Set directory and name properties for installing static lib PDB
Kim Kulling 6 years ago
parent
commit
2ba3d956d1
1 changed files with 10 additions and 0 deletions
  1. 10 0
      code/CMakeLists.txt

+ 10 - 0
code/CMakeLists.txt

@@ -1138,6 +1138,16 @@ if (ASSIMP_ANDROID_JNIIOSYSTEM)
 ENDIF(ASSIMP_ANDROID_JNIIOSYSTEM)
 
 if(MSVC AND ASSIMP_INSTALL_PDB)
+  # When only the static library is built, these properties must
+  # be set to ensure the static lib .pdb is staged for installation.
+  IF(NOT BUILD_SHARED_LIBS)
+    SET_TARGET_PROPERTIES( assimp PROPERTIES
+      COMPILE_PDB_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+      COMPILE_PDB_NAME assimp${LIBRARY_SUFFIX}
+      COMPILE_PDB_NAME_DEBUG assimp${LIBRARY_SUFFIX}${CMAKE_DEBUG_POSTFIX}
+    )
+  ENDIF()
+
   IF(CMAKE_GENERATOR MATCHES "^Visual Studio")
     install(FILES ${Assimp_BINARY_DIR}/code/Debug/assimp${LIBRARY_SUFFIX}${CMAKE_DEBUG_POSTFIX}.pdb
       DESTINATION ${ASSIMP_LIB_INSTALL_DIR}