diff --git a/CMake/mitkMacroInstallTargets.cmake b/CMake/mitkMacroInstallTargets.cmake index 6575dd6e3d..532c9a6046 100644 --- a/CMake/mitkMacroInstallTargets.cmake +++ b/CMake/mitkMacroInstallTargets.cmake @@ -1,138 +1,138 @@ # # MITK specific cross plattform install macro # # Usage: MITK_INSTALL_TARGETS(target1 [target2] ....) # MACRO(MITK_INSTALL_TARGETS) MACRO_PARSE_ARGUMENTS(_install "TARGETS;EXECUTABLES;PLUGINS;LIBRARY_DIRS" "GLOB_PLUGINS" ${ARGN}) LIST(APPEND _install_TARGETS ${_install_DEFAULT_ARGS}) # TODO: how to supply the correct intermediate directory?? # CMAKE_CFG_INTDIR is not expanded to actual values inside the INSTALL(CODE "...") macro ... SET(intermediate_dir ) IF(WIN32 AND NOT MINGW) SET(intermediate_dir Release) ENDIF() SET(DIRS - ${VTK_RUNTIME_LIBRARY_DIRS}/${intermediate_dir} - ${ITK_LIBRARY_DIRS}/${intermediate_dir} + ${MITK_VTK_LIBRARY_DIRS}/${intermediate_dir} + ${MITK_ITK_LIBRARY_DIRS}/${intermediate_dir} ${QT_LIBRARY_DIR} ${QT_LIBRARY_DIR}/../bin ${MITK_BINARY_DIR}/bin/${intermediate_dir} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${intermediate_dir} ) FOREACH(_lib_dir ${_install_LIBRARY_DIRS}) LIST(APPEND DIRS ${_lib_dir}/${intermediate_dir}) ENDFOREACH() IF(GDCM_DIR) LIST(APPEND DIRS ${GDCM_DIR}/bin/${intermediate_dir}) ENDIF() IF(OpenCV_DIR) LIST(APPEND DIRS ${OpenCV_DIR}/bin/${intermediate_dir}) ENDIF() IF(MITK_USE_BLUEBERRY) LIST(APPEND DIRS ${CTK_RUNTIME_LIBRARY_DIRS}/${intermediate_dir}) ENDIF() LIST(REMOVE_DUPLICATES DIRS) if(QT_LIBRARY_DIR MATCHES "^(/lib/|/lib32/|/lib64/|/usr/lib/|/usr/lib32/|/usr/lib64/|/usr/X11R6/)") set(_qt_is_system_qt 1) endif() FOREACH(_target ${_install_EXECUTABLES}) GET_TARGET_PROPERTY(_is_bundle ${_target} MACOSX_BUNDLE) SET(_qt_plugins_install_dirs "") SET(_qt_conf_install_dirs "") SET(_target_locations "") IF(APPLE) IF(_is_bundle) SET(_target_locations ${_target}.app) SET(${_target_locations}_qt_plugins_install_dir ${_target}.app/Contents/MacOS) SET(_bundle_dest_dir ${_target}.app/Contents/MacOS) SET(_qt_plugins_for_current_bundle ${_target}.app/Contents/MacOS) SET(_qt_conf_install_dirs ${_target}.app/Contents/Resources) INSTALL(TARGETS ${_target} BUNDLE DESTINATION . ) ELSE() IF(NOT MACOSX_BUNDLE_NAMES) SET(_qt_conf_install_dirs bin) SET(_target_locations bin/${_target}) SET(${_target_locations}_qt_plugins_install_dir bin) INSTALL(TARGETS ${_target} RUNTIME DESTINATION bin) ELSE() FOREACH(bundle_name ${MACOSX_BUNDLE_NAMES}) LIST(APPEND _qt_conf_install_dirs ${bundle_name}.app/Contents/Resources) SET(_current_target_location ${bundle_name}.app/Contents/MacOS/${_target}) LIST(APPEND _target_locations ${_current_target_location}) SET(${_current_target_location}_qt_plugins_install_dir ${bundle_name}.app/Contents/MacOS) MESSAGE( " SET(${_current_target_location}_qt_plugins_install_dir ${bundle_name}.app/Contents/MacOS) ") INSTALL(TARGETS ${_target} RUNTIME DESTINATION ${bundle_name}.app/Contents/MacOS/) ENDFOREACH() ENDIF() ENDIF() ELSE() SET(_target_locations bin/${_target}${CMAKE_EXECUTABLE_SUFFIX}) SET(${_target_locations}_qt_plugins_install_dir bin) SET(_qt_conf_install_dirs bin) INSTALL(TARGETS ${_target} RUNTIME DESTINATION bin) ENDIF() FOREACH(_target_location ${_target_locations}) IF(NOT _qt_is_system_qt) IF(QT_PLUGINS_DIR) IF(WIN32) INSTALL(DIRECTORY "${QT_PLUGINS_DIR}" DESTINATION ${${_target_location}_qt_plugins_install_dir} CONFIGURATIONS Release FILES_MATCHING REGEX "[^4d]4?${CMAKE_SHARED_LIBRARY_SUFFIX}" ) INSTALL(DIRECTORY "${QT_PLUGINS_DIR}" DESTINATION ${${_target_location}_qt_plugins_install_dir} CONFIGURATIONS Debug FILES_MATCHING REGEX "d4?${CMAKE_SHARED_LIBRARY_SUFFIX}" ) ELSE(WIN32) # install everything, see bug 7143 INSTALL(DIRECTORY "${QT_PLUGINS_DIR}" DESTINATION ${${_target_location}_qt_plugins_install_dir} FILES_MATCHING REGEX "${CMAKE_SHARED_LIBRARY_SUFFIX}" ) ENDIF(WIN32) ENDIF() ENDIF() _fixup_target() ENDFOREACH() IF(NOT _qt_is_system_qt) #-------------------------------------------------------------------------------- # install a qt.conf file # this inserts some cmake code into the install script to write the file SET(_qt_conf_plugin_install_prefix .) IF(APPLE) SET(_qt_conf_plugin_install_prefix ./MacOS) ENDIF() FOREACH(_qt_conf_install_dir ${_qt_conf_install_dirs}) INSTALL(CODE "file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${_qt_conf_install_dir}/qt.conf\" \" [Paths] Prefix=${_qt_conf_plugin_install_prefix} \")") ENDFOREACH() ENDIF() ENDFOREACH() ENDMACRO() diff --git a/CMake/mitkSetupVariables.cmake b/CMake/mitkSetupVariables.cmake index 9981436fad..4f8132f6ef 100644 --- a/CMake/mitkSetupVariables.cmake +++ b/CMake/mitkSetupVariables.cmake @@ -1,142 +1,146 @@ if(MITK_BUILD_ALL_PLUGINS) set(MITK_BUILD_ALL_PLUGINS_OPTION "FORCE_BUILD_ALL") endif() set(LIBPOSTFIX "") # MITK_VERSION set(MITK_VERSION_MAJOR "0") set(MITK_VERSION_MINOR "15") set(MITK_VERSION_PATCH "1") set(MITK_VERSION_STRING "${MITK_VERSION_MAJOR}.${MITK_VERSION_MINOR}.${MITK_VERSION_PATCH}") if(NOT UNIX AND NOT MINGW) set(MITK_WIN32_FORCE_STATIC "STATIC" CACHE INTERNAL "Use this variable to always build static libraries on non-unix platforms") endif() # build the MITK_INCLUDE_DIRS variable set(MITK_INCLUDE_DIRS ${PROJECT_BINARY_DIR}) set(CORE_DIRECTORIES DataManagement Algorithms IO Rendering Interactions Controllers) foreach(d ${CORE_DIRECTORIES}) list(APPEND MITK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/Core/Code/${d}) endforeach() #list(APPEND MITK_INCLUDE_DIRS #${ITK_INCLUDE_DIRS} #${VTK_INCLUDE_DIRS} # ) foreach(d Utilities Utilities/ipPic Utilities/IIL4MITK Utilities/pic2vtk Utilities/tinyxml Utilities/mbilog) list(APPEND MITK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}) endforeach() if(WIN32) list(APPEND MITK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/ipPic/win32) endif() # additional include dirs variables set(ANN_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/ann/include) set(IPSEGMENTATION_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/ipSegmentation) # variables containing librariy names set(MITK_CORE_LIBRARIES mitkCore) set(VTK_FOR_MITK_LIBRARIES vtkGraphics vtkCommon vtkFiltering vtkftgl vtkGraphics vtkHybrid vtkImaging vtkIO vtkParallel vtkRendering vtkVolumeRendering vtkWidgets ${VTK_JPEG_LIBRARIES} ${VTK_PNG_LIBRARIES} ${VTK_ZLIB_LIBRARIES} ${VTK_EXPAT_LIBRARIES} ${VTK_FREETYPE_LIBRARIES} ) # TODO: maybe solve this with lib depends mechanism of CMake set(UTIL_FOR_MITK_LIBRARIES mitkIpPic mitkIpFunc mbilog) set(LIBRARIES_FOR_MITK_CORE ${UTIL_FOR_MITK_LIBRARIES} ${VTK_FOR_MITK_LIBRARIES} ${ITK_LIBRARIES} ) set(MITK_LIBRARIES ${MITK_CORE_LIBRARIES} ${LIBRARIES_FOR_MITK_CORE} pic2vtk IIL4MITK ipSegmentation ann ) + +# variables used in CMake macros which are called from external projects +set(MITK_VTK_LIBRARY_DIRS ${VTK_LIBRARY_DIRS}) +set(MITK_ITK_LIBRARY_DIRS ${ITK_LIBRARY_DIRS}) # variables containing link directories set(MITK_LIBRARY_DIRS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) set(MITK_LINK_DIRECTORIES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} ${ITK_LIBRARY_DIRS} ${VTK_LIBRARY_DIRS}) # Qt support if(MITK_USE_QT) find_package(Qt4 REQUIRED) set(QMITK_INCLUDE_DIRS ${MITK_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/CoreUI/Qmitk ${PROJECT_BINARY_DIR}/CoreUI/Qmitk ) foreach(d QmitkApplicationBase QmitkModels QmitkPropertyObservers) list(APPEND QMITK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/CoreUI/Qmitk/${d}) endforeach() list(APPEND QMITK_INCLUDE_DIRS ${QWT_INCLUDE_DIR}) set(QMITK_LIBRARIES Qmitk ${MITK_LIBRARIES} ${QT_LIBRARIES}) set(QMITK_LINK_DIRECTORIES ${MITK_LINK_DIRECTORIES} ${QT_LIBRARY_DIR}) endif() if(MITK_BUILD_ALL_PLUGINS) set(MITK_BUILD_ALL_PLUGINS_OPTION "FORCE_BUILD_ALL") endif() # create a list of types for template instantiations of itk image access functions function(_create_type_seq TYPES seq_var seqdim_var) set(_seq ) set(_seq_dim ) string(REPLACE "," ";" _pixeltypes "${TYPES}") foreach(_pixeltype ${_pixeltypes}) set(_seq "${_seq}(${_pixeltype})") set(_seq_dim "${_seq_dim}((${_pixeltype},dim))") endforeach() set(${seq_var} "${_seq}" PARENT_SCOPE) set(${seqdim_var} "${_seq_dim}" PARENT_SCOPE) endfunction() set(MITK_ACCESSBYITK_PIXEL_TYPES ) set(MITK_ACCESSBYITK_PIXEL_TYPES_SEQ ) set(MITK_ACCESSBYITK_TYPES_DIMN_SEQ ) foreach(_type INTEGRAL FLOATING COMPOSITE) set(_typelist "${MITK_ACCESSBYITK_${_type}_PIXEL_TYPES}") if(_typelist) if(MITK_ACCESSBYITK_PIXEL_TYPES) set(MITK_ACCESSBYITK_PIXEL_TYPES "${MITK_ACCESSBYITK_PIXEL_TYPES},${_typelist}") else() set(MITK_ACCESSBYITK_PIXEL_TYPES "${_typelist}") endif() endif() _create_type_seq("${_typelist}" MITK_ACCESSBYITK_${_type}_PIXEL_TYPES_SEQ MITK_ACCESSBYITK_${_type}_TYPES_DIMN_SEQ) set(MITK_ACCESSBYITK_PIXEL_TYPES_SEQ "${MITK_ACCESSBYITK_PIXEL_TYPES_SEQ}${MITK_ACCESSBYITK_${_type}_PIXEL_TYPES_SEQ}") set(MITK_ACCESSBYITK_TYPES_DIMN_SEQ "${MITK_ACCESSBYITK_TYPES_DIMN_SEQ}${MITK_ACCESSBYITK_${_type}_TYPES_DIMN_SEQ}") endforeach() set(MITK_ACCESSBYITK_DIMENSIONS_SEQ ) string(REPLACE "," ";" _dimensions "${MITK_ACCESSBYITK_DIMENSIONS}") foreach(_dimension ${_dimensions}) set(MITK_ACCESSBYITK_DIMENSIONS_SEQ "${MITK_ACCESSBYITK_DIMENSIONS_SEQ}(${_dimension})") endforeach() diff --git a/MITKConfig.cmake.in b/MITKConfig.cmake.in index 56c967c313..0203523c26 100644 --- a/MITKConfig.cmake.in +++ b/MITKConfig.cmake.in @@ -1,132 +1,132 @@ # Update the CMake module path SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "@MITK_SOURCE_DIR@/CMake") # Include MITK macros include(MacroParseArguments) include(mitkFunctionOrganizeSources) include(mitkFunctionCreateWindowsBatchScript) include(mitkFunctionInstallProvisioningFiles) include(mitkMacroCreateModuleConf) include(mitkMacroCreateModule) include(mitkMacroCheckModule) include(mitkMacroCreateModuleTests) include(mitkFunctionAddCustomModuleTest) include(mitkMacroUseModule) include(mitkMacroMultiplexPicType) include(mitkMacroInstall) include(mitkMacroInstallHelperApp) include(mitkMacroInstallTargets) include(mitkMacroGenerateToolsLibrary) include(mitkMacroCreateCTKPlugin) # The MITK version number SET(MITK_VERSION_MAJOR "@MITK_VERSION_MAJOR@") SET(MITK_VERSION_MINOR "@MITK_VERSION_MINOR@") SET(MITK_VERSION_PATCH "@MITK_VERSION_PATCH@") # MITK specific variables SET(MITK_SOURCE_DIR "@MITK_SOURCE_DIR@") SET(MITK_BINARY_DIR "@MITK_BINARY_DIR@") SET(UTILITIES_DIR "@UTILITIES_DIR@") SET(REGISTER_QFUNCTIONALITY_CPP_IN "@REGISTER_QFUNCTIONALITY_CPP_IN@") SET(MITK_MODULES_CONF_DIR "@MITK_MODULES_CONF_DIR@") SET(MITK_MODULES_PACKAGE_DEPENDS_DIR "@MITK_MODULES_PACKAGE_DEPENDS_DIR@") SET(MODULES_PACKAGE_DEPENDS_DIRS "@MODULES_PACKAGE_DEPENDS_DIRS@") SET(MITK_DOXYGEN_TAGFILE_NAME "@MITK_DOXYGEN_TAGFILE_NAME@") # Include directory variables SET(MITK_INCLUDE_DIRS "@MITK_INCLUDE_DIRS@") SET(QMITK_INCLUDE_DIRS "@QMITK_INCLUDE_DIRS@") SET(ANN_INCLUDE_DIR "@ANN_INCLUDE_DIR@") SET(IPSEGMENTATION_INCLUDE_DIR "@IPSEGMENTATION_INCLUDE_DIR@") SET(VECMATH_INCLUDE_DIR "@VECMATH_INCLUDE_DIR@") SET(IPFUNC_INCLUDE_DIR "@IPFUNC_INCLUDE_DIR@") SET(MITK_IGT_INCLUDE_DIRS "@MITK_IGT_INCLUDE_DIRS@") # Library variables SET(MITK_LIBRARIES "@MITK_LIBRARIES@") SET(QMITK_LIBRARIES "@QMITK_LIBRARIES@") # Link directory variables SET(MITK_LINK_DIRECTORIES "@MITK_LINK_DIRECTORIES@") SET(QMITK_LINK_DIRECTORIES "@QMITK_LINK_DIRECTORIES@") SET(MITK_LIBRARY_DIRS "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@/plugins") -SET(MITK_VTK_LIBRARY_DIRS "@VTK_LIBRARY_DIRS@") -SET(MITK_ITK_LIBRARY_DIRS "@ITK_LIBRARY_DIRS@") +SET(MITK_VTK_LIBRARY_DIRS "@MITK_VTK_LIBRARY_DIRS@") +SET(MITK_ITK_LIBRARY_DIRS "@MITK_ITK_LIBRARY_DIRS@") # External projects SET(ITK_DIR "@ITK_DIR@") SET(VTK_DIR "@VTK_DIR@") SET(DCMTK_DIR "@DCMTK_DIR@") SET(GDCM_DIR "@GDCM_DIR@") SET(BOOST_ROOT "@BOOST_ROOT@") SET(OpenCV_DIR "@OpenCV_DIR@") SET(MITK_QMAKE_EXECUTABLE "@QT_QMAKE_EXECUTABLE@") SET(MITK_DATA_DIR "@MITK_DATA_DIR@") SET(MITK_RUNTIME_PATH "@MITK_RUNTIME_PATH@") # MITK use variables SET(MITK_USE_QT @MITK_USE_QT@) SET(MITK_USE_BLUEBERRY @MITK_USE_BLUEBERRY@) SET(MITK_USE_Boost @MITK_USE_Boost@) SET(MITK_USE_CTK @MITK_USE_CTK@) SET(MITK_USE_DCMTK @MITK_USE_DCMTK@) SET(MITK_USE_OpenCV @MITK_USE_OpenCV@) # There is no PocoConfig.cmake, so we set Poco specific CMake variables # here. This way the call to FIND_PACKAGE(Poco) in BlueBerryConfig.cmake # finds the Poco distribution supplied by MITK SET(Poco_INCLUDE_DIR "@MITK_SOURCE_DIR@/Utilities/Poco") SET(Poco_LIBRARY_DIR "@MITK_BINARY_DIR@/bin") IF(MITK_USE_IGT) #INCLUDE(${MITK_DIR}/mitkIGTConfig.cmake) ENDIF() IF(NOT MITK_EXPORTS_FILE_INCLUDED) IF(EXISTS "@MITK_EXPORTS_FILE@") SET(MITK_EXPORTS_FILE_INCLUDED 1) INCLUDE("@MITK_EXPORTS_FILE@") ENDIF(EXISTS "@MITK_EXPORTS_FILE@") ENDIF() # BlueBerry support IF(MITK_USE_BLUEBERRY) SET(BlueBerry_DIR "@MITK_BINARY_DIR@/BlueBerry") INCLUDE(mitkMacroCreatePlugin) IF(NOT MITK_SKIP_BUNDLELIST) IF(MITK_USE_EXT) INCLUDE("@MITK_BINARY_DIR@/Bundles/MITKModulesBundleList.cmake") ENDIF() ENDIF(NOT MITK_SKIP_BUNDLELIST) # Don't include the BlueBerry exports file, since the targets are # also exported in the MITK exports file SET(BB_PLUGIN_EXPORTS_FILE_INCLUDED 1) FIND_PACKAGE(BlueBerry) IF(NOT BlueBerry_FOUND) MESSAGE(SEND_ERROR "MITK does not seem to be configured with BlueBerry support. Set MITK_USE_BLUEBERRY to ON in your MITK build configuration.") ENDIF(NOT BlueBerry_FOUND) SET(MITK_PLUGIN_SOURCE_DIRS "@MITK_SOURCE_DIR@/Bundles") SET(MITK_PLUGIN_OUTPUT_DIRS ) IF(MITK_USE_EXT) LIST(APPEND MITK_PLUGIN_OUTPUT_DIRS @MITK_MODULES_PLUGIN_OUTPUT_DIRS@) ENDIF() INCLUDE("@MITK_PLUGIN_USE_FILE@") #SET(CTK_PLUGIN_LIBRARIES ${CTK_PLUGIN_LIBRARIES} @MITK_PLUGIN_TARGETS@) SET(MITK_PLUGIN_PROVISIONING_FILE "@MITK_EXTAPP_PROVISIONING_FILE@") SET(MITK_PROVISIONING_FILES "${BLUEBERRY_PLUGIN_PROVISIONING_FILE}" "${MITK_PLUGIN_PROVISIONING_FILE}") ENDIF(MITK_USE_BLUEBERRY)