2 # MITK specific cross plattform install macro 4 # Usage: MITK_INSTALL_TARGETS(target1 [target2] ....) 7 cmake_parse_arguments(_install
"GLOB_PLUGINS" "" "TARGETS;EXECUTABLES;PLUGINS;LIBRARY_DIRS" ${ARGN})
8 list(APPEND _install_TARGETS ${_install_DEFAULT_ARGS})
10 # TODO: how to supply the correct intermediate directory??
11 # CMAKE_CFG_INTDIR is not expanded to actual values inside the install(CODE
"...") macro ...
12 set(intermediate_dir .)
14 set(intermediate_dir Release)
17 foreach(_target ${_install_EXECUTABLES})
18 get_target_property(_is_bundle ${_target} MACOSX_BUNDLE)
20 set(_qt_conf_install_dirs
"")
21 set(_target_locations
"")
25 set(_target_locations ${_target}.app)
26 set(${_target_locations}_qt_plugins_install_dir ${_target}.app/Contents/MacOS)
27 set(_bundle_dest_dir ${_target}.app/Contents/MacOS)
28 set(_qt_conf_install_dirs ${_target}.app/Contents/Resources)
29 install(TARGETS ${_target} BUNDLE DESTINATION . )
31 if(NOT MACOSX_BUNDLE_NAMES)
32 set(_qt_conf_install_dirs bin)
33 set(_target_locations bin/${_target})
34 install(TARGETS ${_target} RUNTIME DESTINATION bin)
36 foreach(bundle_name ${MACOSX_BUNDLE_NAMES})
37 list(APPEND _qt_conf_install_dirs ${bundle_name}.app/Contents/Resources)
38 set(_current_target_location ${bundle_name}.app/Contents/MacOS/${_target})
39 list(APPEND _target_locations ${_current_target_location})
40 install(TARGETS ${_target} RUNTIME DESTINATION ${bundle_name}.app/Contents/MacOS/)
45 set(_target_locations bin/${_target}${CMAKE_EXECUTABLE_SUFFIX})
46 set(_qt_conf_install_dirs bin)
47 install(TARGETS ${_target} RUNTIME DESTINATION bin)
50 foreach(_target_location ${_target_locations})
54 #-------------------------------------------------------------------------------- 55 # install a qt.conf file 56 # this inserts some cmake code into the install script to write the file 58 set(_qt_conf_plugin_install_prefix .)
60 set(_qt_conf_plugin_install_prefix ./MacOS)
63 foreach(_qt_conf_install_dir ${_qt_conf_install_dirs})
64 install(CODE
"file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${_qt_conf_install_dir}/qt.conf\" \" 66 Prefix=${_qt_conf_plugin_install_prefix}