Return name of debug files that has been stripped

These files can then be installed on the system, too.
This commit is contained in:
Roland Kaufmann 2013-01-23 00:57:07 +01:00
parent e46d950739
commit 8b4a5969c0

View File

@ -35,7 +35,8 @@ if (CMAKE_COMPILER_IS_GNUCXX)
endif (CMAKE_COMPILER_IS_GNUCXX)
# command to separate the debug information from the executable into
# its own file; this must be called for each target
# its own file; this must be called for each target; optionally takes
# the name of a variable to receive the list of .debug files
function (strip_debug_symbols targets)
if (CMAKE_COMPILER_IS_GNUCXX AND OBJCOPY)
foreach (target IN LISTS targets)
@ -83,7 +84,14 @@ function (strip_debug_symbols targets)
COMMAND ${OBJCOPY} ARGS --add-gnu-debuglink=${_target_file_name}.debug ${_target_file}
VERBATIM
)
# add this .debug file to the list
file (RELATIVE_PATH _this_debug_file "${PROJECT_BINARY_DIR}" "${_target_file}.debug")
set (_debug_files ${_debug_files} ${_this_debug_file})
endforeach (target)
# if optional debug list was requested, then copy to output parameter
if (ARGV1)
set (${ARGV1} ${_debug_files} PARENT_SCOPE)
endif (ARGV1)
endif (CMAKE_COMPILER_IS_GNUCXX AND OBJCOPY)
endfunction (strip_debug_symbols targets)