2
#------------------------------------------------------------------------------
5
# Add option to strip wrapping libraries.
6
# Since the wrapping libraries don't get installed by the normal cmake
7
# installation process, this option enables stripping of the libraries
8
# as part of the build process. It should be used on the laguage
9
# targets and the the SimpleITK iterface, as those can be installed
11
option(SimpleITK_BUILD_STRIP "Strip executables and libraries after building." OFF)
12
mark_as_advanced(SimpleITK_BUILD_STRIP)
13
set(CMAKE_STRIP_FLAGS "-x" CACHE STRING "Flags used by strip in the post_build.")
14
mark_as_advanced(CMAKE_STRIP_FLAGS)
15
separate_arguments(CMAKE_STRIP_FLAGS)
17
function(sitk_strip_target tgt)
18
if(NOT SimpleITK_BUILD_STRIP OR "${CMAKE_STRIP}" STREQUAL "" )
21
get_property(type TARGET ${tgt} PROPERTY TYPE)
22
if(NOT type STREQUAL STATIC_LIBRARY)
26
COMMAND ${CMAKE_STRIP} ${CMAKE_STRIP_FLAGS} "$<TARGET_FILE:${tgt}>"