Skip to content

Commit

Permalink
Improve debug builds for MSVC (recastnavigation#443)
Browse files Browse the repository at this point in the history
* Add -d suffix for debug libraries

* Export PDB files for each Debug library
  • Loading branch information
Bromeon authored Oct 30, 2020
1 parent 9337e12 commit e679507
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions DebugUtils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ else()
endif()

add_library(RecastNavigation::DebugUtils ALIAS DebugUtils)
set_target_properties(DebugUtils PROPERTIES DEBUG_POSTFIX -d)

set(DebugUtils_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")

Expand All @@ -23,6 +24,8 @@ target_link_libraries(DebugUtils
set_target_properties(DebugUtils PROPERTIES
SOVERSION ${SOVERSION}
VERSION ${VERSION}
COMPILE_PDB_OUTPUT_DIRECTORY .
COMPILE_PDB_NAME "DebugUtils-d"
)

install(TARGETS DebugUtils
Expand All @@ -34,3 +37,4 @@ install(TARGETS DebugUtils
file(GLOB INCLUDES Include/*.h)
install(FILES ${INCLUDES} DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
install(FILES "$<TARGET_FILE_DIR:DebugUtils>/DebugUtils-d.pdb" CONFIGURATIONS "Debug" DESTINATION "lib")
4 changes: 4 additions & 0 deletions Detour/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ else()
endif()

add_library(RecastNavigation::Detour ALIAS Detour)
set_target_properties(Detour PROPERTIES DEBUG_POSTFIX -d)

set(Detour_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")

Expand All @@ -17,6 +18,8 @@ target_include_directories(Detour PUBLIC
set_target_properties(Detour PROPERTIES
SOVERSION ${SOVERSION}
VERSION ${VERSION}
COMPILE_PDB_OUTPUT_DIRECTORY .
COMPILE_PDB_NAME "Detour-d"
)

install(TARGETS Detour
Expand All @@ -28,3 +31,4 @@ install(TARGETS Detour
file(GLOB INCLUDES Include/*.h)
install(FILES ${INCLUDES} DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
install(FILES "$<TARGET_FILE_DIR:Detour>/Detour-d.pdb" CONFIGURATIONS "Debug" DESTINATION "lib")
4 changes: 4 additions & 0 deletions DetourCrowd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ else ()
endif ()

add_library(RecastNavigation::DetourCrowd ALIAS DetourCrowd)
set_target_properties(DetourCrowd PROPERTIES DEBUG_POSTFIX -d)

set(DetourCrowd_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")

Expand All @@ -21,6 +22,8 @@ target_link_libraries(DetourCrowd
set_target_properties(DetourCrowd PROPERTIES
SOVERSION ${SOVERSION}
VERSION ${VERSION}
COMPILE_PDB_OUTPUT_DIRECTORY .
COMPILE_PDB_NAME "DetourCrowd-d"
)

install(TARGETS DetourCrowd
Expand All @@ -32,3 +35,4 @@ install(TARGETS DetourCrowd
file(GLOB INCLUDES Include/*.h)
install(FILES ${INCLUDES} DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
install(FILES "$<TARGET_FILE_DIR:DetourCrowd>/DetourCrowd-d.pdb" CONFIGURATIONS "Debug" DESTINATION "lib")
4 changes: 4 additions & 0 deletions DetourTileCache/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ else ()
endif ()

add_library(RecastNavigation::DetourTileCache ALIAS DetourTileCache)
set_target_properties(DetourTileCache PROPERTIES DEBUG_POSTFIX -d)

set(DetourTileCache_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")

Expand All @@ -21,6 +22,8 @@ target_link_libraries(DetourTileCache
set_target_properties(DetourTileCache PROPERTIES
SOVERSION ${SOVERSION}
VERSION ${VERSION}
COMPILE_PDB_OUTPUT_DIRECTORY .
COMPILE_PDB_NAME "DetourTileCache-d"
)


Expand All @@ -33,3 +36,4 @@ install(TARGETS DetourTileCache
file(GLOB INCLUDES Include/*.h)
install(FILES ${INCLUDES} DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
install(FILES "$<TARGET_FILE_DIR:DetourTileCache>/DetourTileCache-d.pdb" CONFIGURATIONS "Debug" DESTINATION "lib")
4 changes: 4 additions & 0 deletions Recast/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ else ()
endif ()

add_library(RecastNavigation::Recast ALIAS Recast)
set_target_properties(Recast PROPERTIES DEBUG_POSTFIX -d)

set(Recast_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")

Expand All @@ -17,6 +18,8 @@ target_include_directories(Recast PUBLIC
set_target_properties(Recast PROPERTIES
SOVERSION ${SOVERSION}
VERSION ${VERSION}
COMPILE_PDB_OUTPUT_DIRECTORY .
COMPILE_PDB_NAME "Recast-d"
)

install(TARGETS Recast
Expand All @@ -28,3 +31,4 @@ install(TARGETS Recast
file(GLOB INCLUDES Include/*.h)
install(FILES ${INCLUDES} DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/recastnavigation)
install(FILES "$<TARGET_FILE_DIR:Recast>/Recast-d.pdb" CONFIGURATIONS "Debug" DESTINATION "lib")

0 comments on commit e679507

Please sign in to comment.