[Orxonox-commit 3725] r8405 - in code/trunk/cmake: . tools
rgrieder at orxonox.net
rgrieder at orxonox.net
Thu May 5 17:31:26 CEST 2011
Author: rgrieder
Date: 2011-05-05 17:31:25 +0200 (Thu, 05 May 2011)
New Revision: 8405
Modified:
code/trunk/cmake/InstallConfig.cmake
code/trunk/cmake/PackageConfig.cmake
code/trunk/cmake/tools/TargetUtilities.cmake
Log:
Added MSVC option to install the *.pdb debug symbols files as well.
Modified: code/trunk/cmake/InstallConfig.cmake
===================================================================
--- code/trunk/cmake/InstallConfig.cmake 2011-05-05 14:14:07 UTC (rev 8404)
+++ code/trunk/cmake/InstallConfig.cmake 2011-05-05 15:31:25 UTC (rev 8405)
@@ -38,6 +38,11 @@
OPTION(INSTALL_COPYABLE "${_info_text}" TRUE)
ENDIF()
+IF(MSVC)
+ # Allow developers to install the debug symbols as well (safes the copying)
+ OPTION(INSTALL_PDB_FILES "Also installs the debug symbol files" FALSE)
+ENDIF()
+
# Default relative installation paths
SET(RUNTIME_INSTALL_DIRECTORY ${DEFAULT_RUNTIME_PATH})
SET(LIBRARY_INSTALL_DIRECTORY ${DEFAULT_LIBRARY_PATH})
Modified: code/trunk/cmake/PackageConfig.cmake
===================================================================
--- code/trunk/cmake/PackageConfig.cmake 2011-05-05 14:14:07 UTC (rev 8404)
+++ code/trunk/cmake/PackageConfig.cmake 2011-05-05 15:31:25 UTC (rev 8405)
@@ -82,6 +82,16 @@
DESTINATION bin
CONFIGURATIONS RelForDevs Release RelWithDebInfo MinSizeRel
)
+ IF(INSTALL_PDB_FILES) # MSVC specific: install debug symbols files
+ GET_FILENAME_COMPONENT(_base_name ${_file} NAME_WE)
+ IF(EXISTS ${DEP_BINARY_DIR}/${_base_name}.pdb)
+ INSTALL(
+ FILES ${DEP_BINARY_DIR}/${_base_name}.pdb
+ DESTINATION bin
+ CONFIGURATIONS RelForDevs RelWithDebInfo
+ )
+ ENDIF()
+ ENDIF()
ENDFOREACH(_file)
ELSE()
# Try to filter out all the debug libraries. If the regex doesn't do the
Modified: code/trunk/cmake/tools/TargetUtilities.cmake
===================================================================
--- code/trunk/cmake/tools/TargetUtilities.cmake 2011-05-05 14:14:07 UTC (rev 8404)
+++ code/trunk/cmake/tools/TargetUtilities.cmake 2011-05-05 15:31:25 UTC (rev 8405)
@@ -353,6 +353,24 @@
LIBRARY DESTINATION ${LIBRARY_INSTALL_DIRECTORY}
)
ENDIF()
+ IF(INSTALL_PDB_FILES) # MSVC specific: install debug symbols files
+ FOREACH(_config RelForDevs RelWithDebInfo)
+ GET_TARGET_PROPERTY(_location ${_target_name} LOCATION_${_config})
+ # Get absolute location without dll/exe extension
+ STRING(REGEX REPLACE "^(.+)\\.(dll|exe)$" "\\1" _location_we ${_location})
+ IF(_arg_MODULE)
+ INSTALL(FILES ${_location_we}.pdb
+ DESTINATION ${MODULE_INSTALL_DIRECTORY}
+ CONFIGURATIONS ${_config}
+ )
+ ELSE()
+ INSTALL(FILES ${_location_we}.pdb
+ DESTINATION ${RUNTIME_INSTALL_DIRECTORY}
+ CONFIGURATIONS ${_config}
+ )
+ ENDIF()
+ ENDFOREACH(_config)
+ ENDIF()
ENDIF()
ENDMACRO(TU_ADD_TARGET)
More information about the Orxonox-commit
mailing list