Remove debug information put to output tree when distclean
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
15
cmake/Scripts/RemoveEmptyDir.cmake
Normal file
15
cmake/Scripts/RemoveEmptyDir.cmake
Normal 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)
|
||||
Reference in New Issue
Block a user