Remove debug information put to output tree when distclean

This commit is contained in:
Roland Kaufmann
2013-02-11 14:17:08 +01:00
parent 51a8efa228
commit 01a54e9907
3 changed files with 26 additions and 1 deletions

View File

@@ -28,13 +28,22 @@ macro (opm_dist_clean opm)
GNUmakefile
lib/${${opm}_LIBTOOL_ARCHIVE}
${${opm}_DEBUG}
${tests_DEBUG}
${examples_DEBUG}
${tutorial_DEBUG}
install_manifest.txt
${${opm}_STYLESHEET_COPIED}
)
# script to remove empty directories (can't believe this isn't included!)
set (rmdir "${PROJECT_SOURCE_DIRECTORY}/cmake/Scripts/RemoveEmptyDir.cmake")
add_custom_target (distclean
COMMAND ${CMAKE_COMMAND} -E remove -f ${DISTCLEAN_FILES}
COMMAND ${CMAKE_COMMAND} -E remove_directory CMakeFiles/
COMMAND ${CMAKE_COMMAND} -E remove_directory Testing/
COMMAND ${CMAKE_COMMAND} -DDIR=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -P ${rmdir}
COMMAND ${CMAKE_COMMAND} -DDIR=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} -P ${rmdir}
COMMAND ${CMAKE_COMMAND} -DDIR:LOCATION=${docu_dir} -P ${rmdir}
COMMAND ${CMAKE_COMMAND} -DDIR:LOCATION=${tests_DIR} -P ${rmdir}
# cannot depend on clean because it is only defined in the master Makefile
# not in CMakeFiles/Makefile where this target will end up
# DEPENDS clean

View File

@@ -55,7 +55,8 @@ macro (opm_compile_satellites opm satellite excl_all test_regexp)
LINK_FLAGS "${${opm}_LINKER_FLAGS_STR}"
)
target_link_libraries (${_sat_NAME} ${${opm}_TARGET} ${${opm}_LIBRARIES})
strip_debug_symbols (${_sat_NAME})
strip_debug_symbols (${_sat_NAME} _sat_DEBUG)
list (APPEND ${satellite}_DEBUG ${_sat_DEBUG})
# variable with regular expression doubles as a flag for
# whether tests should be setup or not

View File

@@ -0,0 +1,15 @@
# - Remove a directory if and only if it contains no files
#
# Pass the name of the directory as the DIR variable
if (DIR)
# check if empty
file (GLOB_RECURSE files "${DIR}/*")
# remove only if
if (NOT files)
execute_process (COMMAND
${CMAKE_COMMAND} -E remove_directory "${DIR}"
)
endif (NOT files)
endif (DIR)