File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ if(BUILD_CLIENT_APPS)
2626 FOLDER "OSVR Stock Applications" )
2727 install (TARGETS osvr_print_tree
2828 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime)
29+ osvr_install_symbols_for_target(osvr_print_tree)
2930
3031 ###
3132 # osvr_dump_tree_json - NOT installed
@@ -153,6 +154,7 @@ if(BUILD_SERVER_APP)
153154 FOLDER "OSVR Stock Applications" )
154155 install (TARGETS osvr_server
155156 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime)
157+ osvr_install_symbols_for_target(osvr_server)
156158
157159 # Macro:
158160 # Copy contents of dir for both build and install trees - directories of JSON configs and descriptors
Original file line number Diff line number Diff line change 1+ if (MSVC AND NOT CMAKE_VERSION VERSION_LESS 3.2)
2+ function (osvr_install_symbols_for_target _target)
3+ # debug symbols for MSVC: supported on CMake 3.2 and up where there's a
4+ # generator expression for a target's PDB file
5+ get_target_property (_target_type ${_target} TYPE )
6+ if ("${_target_type} " STREQUAL "EXECUTABLE" OR "${_target_type} " STREQUAL "SHARED_LIBRARY" )
7+ # exe or dll: put it alongside the runtime component
8+ set (DEST ${CMAKE_INSTALL_BINDIR} )
9+ else ()
10+ set (DEST ${CMAKE_INSTALL_LIBDIR} )
11+ endif ()
12+ set (HAS_SYMBOLS_CONDITION $<OR :$<CONFIG:RelWithDebInfo>,$<CONFIG:Debug>>)
13+ install (FILES $<${HAS_SYMBOLS_CONDITION} :$<TARGET_PDB_FILE:${_target} >>
14+ DESTINATION ${DEST}
15+ COMPONENT Devel
16+ ${ARGN} )
17+ endfunction ()
18+ else ()
19+ function (osvr_install_symbols_for_target)
20+ # do nothing if too old of CMake or not MSVC.
21+ endfunction ()
22+ endif ()
Original file line number Diff line number Diff line change 1+ include (InstallDebugSymbols)
2+
13set (LIB_FOLDER "OSVR Libraries" )
24
35set (OSVR_BUILDTREE_TARGETS "" CACHE INTERNAL "" FORCE)
@@ -71,6 +73,9 @@ macro(osvr_add_library)
7173 DESTINATION
7274 ${CMAKE_INSTALL_INCLUDEDIR} /osvr/${LIBNAME}
7375 COMPONENT Devel)
76+
77+ osvr_install_symbols_for_target(${LIBNAME_FULL} )
78+
7479 osvr_append_target(BUILDTREE ${LIBNAME_FULL} )
7580endmacro ()
7681
You can’t perform that action at this time.
0 commit comments