Use correct PDB paths

The previously-specified paths were only correct for a static library
build.
I therefore fenced off that code to be specific to static library
builds.

For shared library builds, I added a generator-expression-based
alternative.
Annoyingly, this won't work with static library builds, so we don't get
the concise, reliable version in all circumstances.

I've avoided modifying any of the paths anything ends up at to avoid
breaking changes.

Resolves https://github.com/assimp/assimp/issues/4269
pull/5213/head
AnyOldName3 2023-08-23 17:19:01 +01:00
parent 72c10d856f
commit e50233b2c1
1 changed files with 20 additions and 16 deletions

View File

@ -1418,9 +1418,8 @@ if(MSVC AND ASSIMP_INSTALL_PDB)
COMPILE_PDB_NAME assimp${LIBRARY_SUFFIX} COMPILE_PDB_NAME assimp${LIBRARY_SUFFIX}
COMPILE_PDB_NAME_DEBUG assimp${LIBRARY_SUFFIX}${CMAKE_DEBUG_POSTFIX} COMPILE_PDB_NAME_DEBUG assimp${LIBRARY_SUFFIX}${CMAKE_DEBUG_POSTFIX}
) )
ENDIF()
IF(CMAKE_GENERATOR MATCHES "^Visual Studio") IF(GENERATOR_IS_MULTI_CONFIG)
install(FILES ${Assimp_BINARY_DIR}/code/Debug/assimp${LIBRARY_SUFFIX}${CMAKE_DEBUG_POSTFIX}.pdb install(FILES ${Assimp_BINARY_DIR}/code/Debug/assimp${LIBRARY_SUFFIX}${CMAKE_DEBUG_POSTFIX}.pdb
DESTINATION ${ASSIMP_LIB_INSTALL_DIR} DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
CONFIGURATIONS Debug CONFIGURATIONS Debug
@ -1439,6 +1438,11 @@ if(MSVC AND ASSIMP_INSTALL_PDB)
CONFIGURATIONS RelWithDebInfo CONFIGURATIONS RelWithDebInfo
) )
ENDIF() ENDIF()
ELSE()
install(FILES $<TARGET_PDB_FILE:assimp>
DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
)
ENDIF()
ENDIF () ENDIF ()
if (ASSIMP_COVERALLS) if (ASSIMP_COVERALLS)