2 #! \brief Install CTK plug-ins.
4 #! Installs the given list of CTK plug-in targets in the given
5 #! <code>DESTINATION</code>. If an entry in <code>TARGETS</code>
6 #! is not a known target, a warning will be issued. This macro
7 #! can also install imported plug-in targets.
9 #! \note This macro is usually not called directly. It is used in
10 #! mitk_create_module() and mitkFunctionInstallThirdPartyCTKPlugins().
12 #! \param TARGETS (optional) A list of plug-ins (target names) to install.
13 #! \param DESTINATION (optional) The install destination. Defaults to "bin/".
16 cmake_parse_arguments(_INSTALL
"" "DESTINATION" "TARGETS" ${ARGN})
18 if(NOT _INSTALL_DESTINATION)
19 set(_INSTALL_DESTINATION
"bin/")
21 set(_INSTALL_DESTINATION "${_INSTALL_DESTINATION}/
")
24 foreach(_install_target ${_INSTALL_TARGETS})
25 if(TARGET ${_install_target})
26 get_target_property(_is_imported ${_install_target} IMPORTED)
28 get_target_property(_import_loc_debug ${_install_target} IMPORTED_LOCATION_DEBUG)
29 get_target_property(_import_loc_release ${_install_target} IMPORTED_LOCATION_RELEASE)
30 get_filename_component(_target_filename_debug "${_import_loc_debug}
" NAME)
31 get_filename_component(_target_filename_release "${_import_loc_release}
" NAME)
32 install(FILES ${_import_loc_debug}
33 DESTINATION ${_INSTALL_DESTINATION}
35 install(FILES ${_import_loc_release}
36 DESTINATION ${_INSTALL_DESTINATION}
37 CONFIGURATIONS Release)
38 if(UNIX AND NOT APPLE)
39 if(_target_filename_debug)
40 install(CODE "file(RPATH_REMOVE
41 FILE \
"\${CMAKE_INSTALL_PREFIX}/${_INSTALL_DESTINATION}/${_target_filename_debug}\")")
43 if(_target_filename_release)
44 install(CODE "file(RPATH_REMOVE
45 FILE \"\${CMAKE_INSTALL_PREFIX}/${_INSTALL_DESTINATION}/${_target_filename_release}\
")")
49 install(TARGETS ${_install_target}
50 RUNTIME DESTINATION ${_INSTALL_DESTINATION}
51 LIBRARY DESTINATION ${_INSTALL_DESTINATION}
52 #ARCHIVE DESTINATION ${_INSTALL_DESTINATION}
56 message(WARNING "Ignoring
unknown plug-
in target \"${_install_target}\
" for installation.")
static const unsigned int unknown
Unknown size marker.
static bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4)
mitkFunctionInstallCTKPlugin()
Install CTK plug-ins.