diff --git a/CMake/mitkInstallRules.cmake b/CMake/mitkInstallRules.cmake index 80c16985ac..9150bdd2c1 100644 --- a/CMake/mitkInstallRules.cmake +++ b/CMake/mitkInstallRules.cmake @@ -1,197 +1,77 @@ -MITK_INSTALL(FILES "${MITK_SOURCE_DIR}/mitk.ico") -MITK_INSTALL(FILES "${MITK_SOURCE_DIR}/mitk.bmp") - -# Install CTK Qt (designer) plugins -if(MITK_USE_CTK) - if(EXISTS ${CTK_QTDESIGNERPLUGINS_DIR}) - set(_qtplugin_install_destinations) - if(MACOSX_BUNDLE_NAMES) - foreach(bundle_name ${MACOSX_BUNDLE_NAMES}) - list(APPEND _qtplugin_install_destinations - ${bundle_name}.app/Contents/MacOS/${_install_DESTINATION}/plugins/designer) - endforeach() +# Install MITK icon and logo + +MITK_INSTALL(FILES + "${MITK_SOURCE_DIR}/mitk.ico" + "${MITK_SOURCE_DIR}/mitk.bmp") + +# Install Qt plugins + +if(MITK_USE_Qt5) + get_property(_qmake_location TARGET ${Qt5Core_QMAKE_EXECUTABLE} PROPERTY IMPORT_LOCATION) + get_filename_component(_qmake_path ${_qmake_location} DIRECTORY) + + if(WIN32) + set(_prefix "") + set(_ext ".dll") + elseif(UNIX) + set(_prefix "lib") + if(APPLE) + set(_ext ".dylib") else() - list(APPEND _qtplugin_install_destinations bin/plugins/designer) + set(_ext ".so") endif() + endif() - set(_ctk_qt_plugin_folder_release) - set(_ctk_qt_plugin_folder_debug) - if(NOT CMAKE_CFG_INTDIR STREQUAL ".") - set(_ctk_qt_plugin_folder_release "Release/") - set(_ctk_qt_plugin_folder_debug "Debug/") - endif() + set(_install_DESTINATION "plugins/sqldrivers") + MITK_INSTALL(FILES "${_qmake_path}/../plugins/sqldrivers/${_prefix}qsqlite${_ext}") - foreach(_qtplugin_install_dir ${_qtplugin_install_destinations}) - install(DIRECTORY "${CTK_QTDESIGNERPLUGINS_DIR}/designer/${_ctk_qt_plugin_folder_release}" - DESTINATION ${_qtplugin_install_dir} - CONFIGURATIONS Release - ) - install(DIRECTORY "${CTK_QTDESIGNERPLUGINS_DIR}/designer/${_ctk_qt_plugin_folder_debug}" - DESTINATION ${_qtplugin_install_dir} - CONFIGURATIONS Debug - ) - endforeach() - endif() -endif() + set(_install_DESTINATION "plugins/imageformats") + MITK_INSTALL(FILES "${_qmake_path}/../plugins/imageformats/${_prefix}qsvg${_ext}") -# related to MITK:T19679 -if(MACOSX_BUNDLE_NAMES) - foreach(bundle_name ${MACOSX_BUNDLE_NAMES}) - get_property(_qmake_location TARGET ${Qt5Core_QMAKE_EXECUTABLE} - PROPERTY IMPORT_LOCATION) - get_filename_component(_qmake_path "${_qmake_location}" DIRECTORY) - install(FILES "${_qmake_path}/../plugins/platforms/libqcocoa.dylib" - DESTINATION "${bundle_name}.app/Contents/MacOS/platforms" - CONFIGURATIONS Release) - install(FILES "${_qmake_path}/../plugins/sqldrivers/libqsqlite.dylib" - DESTINATION "${bundle_name}.app/Contents/MacOS/sqldrivers" - CONFIGURATIONS Release) - install(FILES "${_qmake_path}/../plugins/iconengines/libqsvgicon.dylib" - DESTINATION "${bundle_name}.app/Contents/MacOS/iconengines" - CONFIGURATIONS Release) - # related to MITK:T19679-InstallQtWebEnginProcess - if(MITK_USE_Qt5) - get_filename_component(ABS_DIR_HELPERS "${_qmake_path}/../lib/QtWebEngineCore.framework/Helpers" REALPATH) - install(DIRECTORY ${ABS_DIR_HELPERS} - DESTINATION "${bundle_name}.app/Contents/Frameworks/QtWebEngineCore.framework/" - CONFIGURATIONS Release) - endif() - endforeach() -endif() + set(_install_DESTINATION "plugins/iconengines") + MITK_INSTALL(FILES "${_qmake_path}/../plugins/iconengines/${_prefix}qsvgicon${_ext}") -if(WIN32) - if(MITK_USE_Qt5) - get_property(_qmake_location TARGET ${Qt5Core_QMAKE_EXECUTABLE} - PROPERTY IMPORT_LOCATION) - get_filename_component(_qmake_path "${_qmake_location}" DIRECTORY) - install(FILES "${_qmake_path}/../plugins/platforms/qwindows.dll" - DESTINATION "bin/plugins/platforms" - CONFIGURATIONS Release) - install(FILES "${_qmake_path}/../plugins/sqldrivers/qsqlite.dll" - DESTINATION "bin/plugins/sqldrivers" - CONFIGURATIONS Release) - install(FILES "${_qmake_path}/../plugins/imageformats/qsvg.dll" - DESTINATION "bin/plugins/imageformats" - CONFIGURATIONS Release) - install(FILES "${_qmake_path}/../plugins/iconengines/qsvgicon.dll" - DESTINATION "bin/plugins/iconengines" - CONFIGURATIONS Release) - - MITK_INSTALL( FILES "${_qmake_path}/QtWebEngineProcess.exe") - - install(DIRECTORY "${_qmake_path}/../resources/" - DESTINATION "bin/resources/" - CONFIGURATIONS Release) - install(DIRECTORY "${_qmake_path}/../translations/qtwebengine_locales/" - DESTINATION "bin/translations/qtwebengine_locales/" - CONFIGURATIONS Release) - install(FILES "${_qmake_path}/../plugins/platforms/qwindowsd.dll" - DESTINATION "bin/plugins/platforms" - CONFIGURATIONS Debug) - install(FILES "${_qmake_path}/../plugins/sqldrivers/qsqlited.dll" - DESTINATION "bin/plugins/sqldrivers" - CONFIGURATIONS Debug) - install(FILES "${_qmake_path}/../plugins/imageformats/qsvgd.dll" - DESTINATION "bin/plugins/imageformats" - CONFIGURATIONS Debug) - install(FILES "${_qmake_path}/../plugins/iconengines/qsvgicond.dll" - DESTINATION "bin/plugins/iconengines" - CONFIGURATIONS Debug) - install(DIRECTORY "${_qmake_path}/../resources/" - DESTINATION "bin/resources/" - CONFIGURATIONS Debug) - install(DIRECTORY "${_qmake_path}/../translations/qtwebengine_locales/" - DESTINATION "bin/translations/qtwebengine_locales/" - CONFIGURATIONS Debug) - endif() + # Install platform-specific Qt plugins - #DCMTK Dlls install target (shared libs on gcc only) - if(MINGW AND DCMTK_ofstd_LIBRARY) - set(_dcmtk_libs - ${DCMTK_dcmdata_LIBRARY} - ${DCMTK_dcmimgle_LIBRARY} - ${DCMTK_dcmnet_LIBRARY} - ${DCMTK_ofstd_LIBRARY} - ) - - foreach(_dcmtk_lib ${_dcmtk_libs}) - MITK_INSTALL(FILES ${_dcmtk_lib} ) - endforeach() - endif() + set(_install_DESTINATION "plugins/platforms") - #MinGW dll - if(MINGW) - find_library(MINGW_RUNTIME_DLL "mingwm10.dll" HINTS ${CMAKE_FIND_ROOT_PATH}/sys-root/mingw/bin) - if(MINGW_RUNTIME_DLL) - MITK_INSTALL(FILES ${MINGW_RUNTIME_DLL} ) - else() - message(SEND_ERROR "Could not find mingwm10.dll which is needed for a proper install") - endif() + if(WIN32) + MITK_INSTALL(FILES "${_qmake_path}/../plugins/platforms/qwindows.dll") + elseif(APPLE) + MITK_INSTALL(FILES "${_qmake_path}/../plugins/platforms/libqcocoa.dylib") - find_library(MINGW_GCC_RUNTIME_DLL "libgcc_s_dw2-1.dll" HINTS ${CMAKE_FIND_ROOT_PATH}/sys-root/mingw/bin) - if(MINGW_GCC_RUNTIME_DLL) - MITK_INSTALL(FILES ${MINGW_GCC_RUNTIME_DLL} ) - else() - message(SEND_ERROR "Could not find libgcc_s_dw2-1.dll which is needed for a proper install") - endif() + set(_install_DESTINATION "plugins/styles") + MITK_INSTALL(FILES "${_qmake_path}/../plugins/styles/libqmacstyle.dylib") + elseif(UNIX) + MITK_INSTALL(FILES + "${_qmake_path}/../plugins/platforms/libqxcb.so" + "${_qmake_path}/../plugins/platforms/libqxcb-glx-integration.so") endif() -else() - - #DCMTK Dlls install target (shared libs on gcc only) - if(DCMTK_ofstd_LIBRARY) - set(_dcmtk_libs - ${DCMTK_dcmdata_LIBRARY} - ${DCMTK_dcmimgle_LIBRARY} - ${DCMTK_dcmnet_LIBRARY} - ${DCMTK_ofstd_LIBRARY} - ) - foreach(_dcmtk_lib ${_dcmtk_libs}) - #MITK_INSTALL(FILES ${_dcmtk_lib} DESTINATION lib) - endforeach() - endif() + # Install Qt WebEngine + + if(APPLE) + set(_install_DESTINATION "../Frameworks/QtWebEngineCore.framework") -# We need to install Webengineprocess and related files on unix as well - if(UNIX) - if(MITK_USE_Qt5) - get_property(_qmake_location TARGET ${Qt5Core_QMAKE_EXECUTABLE} - PROPERTY IMPORT_LOCATION) - get_filename_component(_qmake_path "${_qmake_location}" DIRECTORY) - - install(FILES "${_qmake_path}/../plugins/platforms/libqxcb.so" - DESTINATION "bin/plugins/platforms") - install(FILES "${_qmake_path}/../plugins/sqldrivers/libqsqlite.so" - DESTINATION "bin/plugins/sqldrivers") - install(FILES "${_qmake_path}/../plugins/imageformats/libqsvg.so" - DESTINATION "bin/plugins/imageformats") - install(FILES "${_qmake_path}/../plugins/iconengines/libqsvgicon.so" - DESTINATION "bin/plugins/iconengines") - install(FILES "${_qmake_path}/../plugins/xcbglintegrations/libqxcb-glx-integration.so" - DESTINATION "bin/plugins/xcbglintegrations") - - MITK_INSTALL_HELPER_APP( EXECUTABLES "${_qmake_path}/../libexec/QtWebEngineProcess") - - install(DIRECTORY "${_qmake_path}/../resources/" - DESTINATION "bin/resources/") - install(DIRECTORY "${_qmake_path}/../translations/qtwebengine_locales/" - DESTINATION "bin/translations/qtwebengine_locales/") + get_filename_component(_real_path "${_qmake_path}/../lib/QtWebEngineCore.framework/Helpers" REALPATH) + MITK_INSTALL(DIRECTORY ${_real_path}) + + get_filename_component(_real_path "${_qmake_path}/../lib/QtWebEngineCore.framework/Resources" REALPATH) + MITK_INSTALL(DIRECTORY ${_real_path}) + else() + set(_install_DESTINATION "") + + if(WIN32) + MITK_INSTALL(FILES "${_qmake_path}/QtWebEngineProcess.exe") + elseif(UNIX) + MITK_INSTALL(FILES "${_qmake_path}/../libexec/QtWebEngineProcess") endif() - endif() -endif() + MITK_INSTALL(DIRECTORY "${_qmake_path}/../resources") -#install Matchpoint libs that are currently not auto detected -if(MITK_USE_MatchPoint) - install(DIRECTORY "${MITK_EXTERNAL_PROJECT_PREFIX}/bin/" - DESTINATION "bin" - FILES_MATCHING PATTERN "MAPUtilities*") - install(DIRECTORY "${MITK_EXTERNAL_PROJECT_PREFIX}/bin/" - DESTINATION "bin" - FILES_MATCHING PATTERN "MAPAlgorithms*") + set(_install_DESTINATION "translations") + MITK_INSTALL(DIRECTORY "${_qmake_path}/../translations/qtwebengine_locales") + endif() endif() -if(MITK_USE_BetData) - install(DIRECTORY "${BetData_DIR}" - DESTINATION "bin" - FILES_MATCHING PATTERN "*") -endif() +set(_install_DESTINATION "") # IMPORTANT: Restore default install destination! diff --git a/Modules/DicomRT/autoload/IO/CMakeLists.txt b/Modules/DicomRT/autoload/IO/CMakeLists.txt index e4f46be87f..f8a1d7e2e2 100644 --- a/Modules/DicomRT/autoload/IO/CMakeLists.txt +++ b/Modules/DicomRT/autoload/IO/CMakeLists.txt @@ -1,7 +1,9 @@ MITK_CREATE_MODULE( DicomRTIO INCLUDE_DIRS PRIVATE src/IO - DEPENDS PUBLIC MitkDicomRT + DEPENDS + PUBLIC MitkDicomRT + PRIVATE MitkDicomReaderServices PACKAGE_DEPENDS PUBLIC DCMTK AUTOLOAD_WITH MitkCore -) \ No newline at end of file +)