diff --git a/Applications/CoreApp/CMakeLists.txt b/Applications/CoreApp/CMakeLists.txt index ab3640aa40..75f728f70e 100644 --- a/Applications/CoreApp/CMakeLists.txt +++ b/Applications/CoreApp/CMakeLists.txt @@ -1,69 +1,70 @@ FIND_PACKAGE(BlueBerry REQUIRED) INCLUDE(${QT_USE_FILE}) INCLUDE_DIRECTORIES( ${BLUEBERRY_PLUGIN_SOURCE_DIRS} ${org_blueberry_osgi_INCLUDE_DIRS} ${Poco_INCLUDE_DIRS} ${mbilog_INCLUDE_DIRS} ) LINK_DIRECTORIES(${Poco_LIBRARY_DIRS} ${BLUEBERRY_PLUGINS_OUTPUT_DIR}/org.blueberry.osgi/bin ) IF(MITK_SHOW_CONSOLE_WINDOW) ADD_EXECUTABLE(CoreApp MACOSX_BUNDLE CoreApp.cpp) ELSE(MITK_SHOW_CONSOLE_WINDOW) ADD_EXECUTABLE(CoreApp MACOSX_BUNDLE WIN32 CoreApp.cpp) ENDIF(MITK_SHOW_CONSOLE_WINDOW) IF (WIN32) FIND_PACKAGE(Qt4) TARGET_LINK_LIBRARIES(CoreApp ${QT_QTCORE_LIBRARY} ${QT_QTMAIN_LIBRARY}) ENDIF(WIN32) TARGET_LINK_LIBRARIES(CoreApp optimized PocoFoundation debug PocoFoundationd optimized PocoUtil debug PocoUtild org_blueberry_osgi) SET_TARGET_PROPERTIES(CoreApp PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${CMAKE_INSTALL_RPATH}/BlueBerry/org.blueberry.osgi/bin") # subproject support ADD_DEPENDENCIES(MITK-CoreUI CoreApp) IF(MITK_ENABLE_GUI_TESTING) ADD_DEPENDENCIES(MITK-CoreUI solstice) ENDIF() SET(_plugin_deps ${BLUEBERRY_ENABLED_PLUGINS} ${MITK_CORE_ENABLED_PLUGINS} ) IF(_plugin_deps) # Make sure all enabled plug-ins are up to date ADD_DEPENDENCIES(CoreApp ${_plugin_deps}) ENDIF() SET(BLUEBERRY_PLUGIN_CACHE_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugin_cache") CONFIGURE_FILE(CoreApp.ini ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp.ini) IF(WIN32) FOREACH(COREAPP_BUILD_TYPE debug release) mitkFunctionCreateWindowsBatchScript(startCoreApp.bat.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/startCoreApp_${COREAPP_BUILD_TYPE}.bat ${COREAPP_BUILD_TYPE}) ENDFOREACH() ENDIF(WIN32) MITK_INSTALL_TARGETS(EXECUTABLES CoreApp GLOB_PLUGINS ) +mitkFunctionInstallProvisioningFiles(${BLUEBERRY_PLUGIN_PROVISIONING_FILE} ${MITK_COREAPP_PROVISIONING_FILE}) IF(UNIX AND MITK_INSTALL_RPATH_RELATIVE AND NOT APPLE) INSTALL(PROGRAMS "${MITK_SOURCE_DIR}/CMake/RunInstalledApp.sh" DESTINATION "." RENAME CoreApp.sh) ENDIF() SET(MITK_CPACK_PACKAGE_EXECUTABLES ${MITK_CPACK_PACKAGE_EXECUTABLES} "CoreApp;MITK - CoreApp Application" CACHE INTERNAL "Collecting windows shortcuts to executables") diff --git a/Applications/CoreApp/CoreApp.cpp b/Applications/CoreApp/CoreApp.cpp index 9e87ec41ae..d04ffc65c3 100644 --- a/Applications/CoreApp/CoreApp.cpp +++ b/Applications/CoreApp/CoreApp.cpp @@ -1,91 +1,86 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/ for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include #include #include #include class QSafeApplication : public QApplication { public: QSafeApplication(int& argc, char** argv) : QApplication(argc, argv) {} /** * Reimplement notify to catch unhandled exceptions and open an error message. * * @param receiver * @param event * @return */ bool notify(QObject* receiver, QEvent* event) { QString msg; try { return QApplication::notify(receiver, event); } catch (Poco::Exception& e) { msg = QString::fromStdString(e.displayText()); } catch (std::exception& e) { msg = e.what(); } catch (...) { msg = "Unknown exception"; } QString text( "An error occurred. You should save all data and quit the program to prevent possible data loss.\nSee the error log for details.\n\n"); text += msg; QMessageBox::critical(0, "Error", text); return false; } }; int main(int argc, char** argv) { QSafeApplication safeApp(argc, argv); safeApp.setApplicationName("CoreApp"); safeApp.setOrganizationName("DKFZ"); // These paths replace the .ini file and are tailored for installation // packages created with CPack. If a .ini file is presented, it will // overwrite the settings in MapConfiguration Poco::Path basePath(argv[0]); basePath.setFileName(""); - Poco::Path BlueBerryPath(basePath); - BlueBerryPath.pushDirectory("BlueBerry"); - - Poco::Path corePath(basePath); - corePath.pushDirectory("CoreBundles"); - - std::string pluginDirs = BlueBerryPath.toString() + ";" + corePath.toString(); + Poco::Path provFile(basePath); + provFile.setFileName("CoreApp.provisioning"); Poco::Util::MapConfiguration* coreConfig(new Poco::Util::MapConfiguration()); - coreConfig->setString(berry::Platform::ARG_PLUGIN_DIRS, pluginDirs); + coreConfig->setString(berry::Platform::ARG_PROVISIONING, provFile.toString()); coreConfig->setString(berry::Platform::ARG_APPLICATION, "org.mitk.qt.application"); return berry::Starter::Run(argc, argv, coreConfig); } diff --git a/Applications/ExtApp/CMakeLists.txt b/Applications/ExtApp/CMakeLists.txt index d0ddc581cf..224844c43a 100644 --- a/Applications/ExtApp/CMakeLists.txt +++ b/Applications/ExtApp/CMakeLists.txt @@ -1,67 +1,68 @@ FIND_PACKAGE(BlueBerry REQUIRED) # TODO: this can be removed after resolving factory issues, it's only necessary for the registration call in main() MITK_USE_MODULE(MitkExt) INCLUDE(${QT_USE_FILE}) INCLUDE_DIRECTORIES( ${BLUEBERRY_PLUGIN_SOURCE_DIRS} ${org_blueberry_osgi_INCLUDE_DIRS} ${Poco_INCLUDE_DIRS} ${ALL_INCLUDE_DIRECTORIES} ) LINK_DIRECTORIES(${Poco_LIBRARY_DIRS} ${BLUEBERRY_PLUGINS_OUTPUT_DIR}/org.blueberry.osgi/bin ) IF(MITK_SHOW_CONSOLE_WINDOW) ADD_EXECUTABLE(ExtApp MACOSX_BUNDLE ExtApp.cpp) ELSE(MITK_SHOW_CONSOLE_WINDOW) ADD_EXECUTABLE(ExtApp MACOSX_BUNDLE WIN32 ExtApp.cpp) ENDIF(MITK_SHOW_CONSOLE_WINDOW) IF (WIN32) FIND_PACKAGE(Qt4) TARGET_LINK_LIBRARIES(ExtApp ${QT_QTCORE_LIBRARY} ${QT_QTMAIN_LIBRARY}) ENDIF(WIN32) TARGET_LINK_LIBRARIES(ExtApp optimized PocoFoundation debug PocoFoundationd optimized PocoUtil debug PocoUtild org_blueberry_osgi ${ALL_LIBRARIES}) SET_TARGET_PROPERTIES(ExtApp PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${CMAKE_INSTALL_RPATH}/BlueBerry/org.blueberry.osgi/bin") SET(_plugin_deps ${BLUEBERRY_ENABLED_PLUGINS} ${MITK_EXT_ENABLED_PLUGINS} ${MITK_MODULES_ENABLED_PLUGINS} ) IF(_plugin_deps) # Make sure all enabled plug-ins are up to date ADD_DEPENDENCIES(ExtApp ${_plugin_deps}) ENDIF() SET(BLUEBERRY_PLUGIN_CACHE_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugin_cache") CONFIGURE_FILE(ExtApp.ini ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ExtApp.ini) IF(WIN32) FOREACH(EXTAPP_BUILD_TYPE debug release) mitkFunctionCreateWindowsBatchScript(startExtApp.bat.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/startExtApp_${EXTAPP_BUILD_TYPE}.bat ${EXTAPP_BUILD_TYPE}) ENDFOREACH() ENDIF(WIN32) MITK_INSTALL_TARGETS(EXECUTABLES ExtApp GLOB_PLUGINS ) +mitkFunctionInstallProvisioningFiles(${BLUEBERRY_PLUGIN_PROVISIONING_FILE} ${MITK_EXTAPP_PROVISIONING_FILE}) IF(UNIX AND MITK_INSTALL_RPATH_RELATIVE AND NOT APPLE) INSTALL(PROGRAMS "${MITK_SOURCE_DIR}/CMake/RunInstalledApp.sh" DESTINATION "." RENAME ExtApp.sh) ENDIF() SET(MITK_CPACK_PACKAGE_EXECUTABLES ${MITK_CPACK_PACKAGE_EXECUTABLES} "ExtApp;MITK - ExtApp Application" CACHE INTERNAL "Collecting windows shortcuts to executables") diff --git a/Applications/ExtApp/ExtApp.cpp b/Applications/ExtApp/ExtApp.cpp index eaedaa5944..b6d0eb8440 100644 --- a/Applications/ExtApp/ExtApp.cpp +++ b/Applications/ExtApp/ExtApp.cpp @@ -1,99 +1,97 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/ for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include #include #include #include #include class QtSafeApplication : public QApplication { public: QtSafeApplication(int& argc, char** argv) : QApplication(argc, argv) {} /** * Reimplement notify to catch unhandled exceptions and open an error message. * * @param receiver * @param event * @return */ bool notify(QObject* receiver, QEvent* event) { QString msg; try { return QApplication::notify(receiver, event); } catch (Poco::Exception& e) { msg = QString::fromStdString(e.displayText()); } catch (std::exception& e) { msg = e.what(); } catch (...) { msg = "Unknown exception"; } QString text("An error occurred. You should save all data and quit the program to " "prevent possible data loss.\nSee the error log for details.\n\n"); text += msg; QMessageBox::critical(0, "Error", text); return false; } }; int main(int argc, char** argv) { // Create a QApplication instance first QtSafeApplication qSafeApp(argc, argv); qSafeApp.setApplicationName("ExtApp"); qSafeApp.setOrganizationName("DKFZ"); RegisterCoreExtObjectFactory(); // These paths replace the .ini file and are tailored for installation // packages created with CPack. If a .ini file is presented, it will // overwrite the settings in MapConfiguration Poco::Path basePath(argv[0]); basePath.setFileName(""); - Poco::Path BlueBerryPath(basePath); - BlueBerryPath.pushDirectory("BlueBerry"); - - Poco::Path corePath(basePath); - corePath.pushDirectory("CoreBundles"); + Poco::Path provFile(basePath); + provFile.setFileName("ExtApp.provisioning"); Poco::Path extPath(basePath); extPath.pushDirectory("ExtBundles"); - std::string pluginDirs = BlueBerryPath.toString() + ";" + corePath.toString() + ";" + extPath.toString(); + std::string pluginDirs = extPath.toString(); Poco::Util::MapConfiguration* extConfig(new Poco::Util::MapConfiguration()); extConfig->setString(berry::Platform::ARG_PLUGIN_DIRS, pluginDirs); + extConfig->setString(berry::Platform::ARG_PROVISIONING, provFile.toString()); extConfig->setString(berry::Platform::ARG_APPLICATION, "org.mitk.qt.extapplication"); return berry::Starter::Run(argc, argv, extConfig); } diff --git a/BlueBerry/BlueBerryConfig.cmake.in b/BlueBerry/BlueBerryConfig.cmake.in index f2d924969a..f089f8bb4a 100644 --- a/BlueBerry/BlueBerryConfig.cmake.in +++ b/BlueBerry/BlueBerryConfig.cmake.in @@ -1,53 +1,53 @@ SET(BLUEBERRY_PLUGINS_SOURCE_DIR "@BLUEBERRY_PLUGINS_SOURCE_DIR@") SET(BLUEBERRY_PLUGINS_BINARY_DIR "@BLUEBERRY_PLUGINS_BINARY_DIR@") SET(BLUEBERRY_PLUGIN_SOURCE_DIRS "@BLUEBERRY_PLUGINS_SOURCE_DIR@") SET(BLUEBERRY_PLUGINS_OUTPUT_DIR "@BLUEBERRY_PLUGINS_OUTPUT_DIR@") SET(BLUEBERRY_SOURCE_DIR "@BLUEBERRY_SOURCE_DIR@") SET(BlueBerry_SOURCE_DIR "@BLUEBERRY_SOURCE_DIR@") SET(BLUEBERRY_BINARY_DIR "@BLUEBERRY_BINARY_DIR@") INCLUDE("@BB_PLUGIN_USE_FILE@") IF(NOT BB_PLUGIN_EXPORTS_FILE_INCLUDED AND NOT CMAKE_PROJECT_NAME STREQUAL "MITK") INCLUDE("@BB_PLUGIN_EXPORTS_FILE@") SET(BB_PLUGIN_EXPORTS_FILE_INCLUDED 1) ENDIF() SET(BLUEBERRY_DEBUG_POSTFIX @BLUEBERRY_DEBUG_POSTFIX@) SET(BLUEBERRY_USE_QT_HELP @BLUEBERRY_USE_QT_HELP@) SET(QT_HELPGENERATOR_EXECUTABLE "@QT_HELPGENERATOR_EXECUTABLE@") SET(QT_COLLECTIONGENERATOR_EXECUTABLE "@QT_COLLECTIONGENERATOR_EXECUTABLE@") SET(QT_ASSISTANT_EXECUTABLE "@QT_ASSISTANT_EXECUTABLE@") SET(CTK_DIR "@CTK_DIR@") FIND_PACKAGE(CTK REQUIRED) SET(BLUEBERRY_PLUGIN_TARGETS @my_plugin_targets@) SET(BLUEBERRY_ENABLED_PLUGINS @my_plugin_targets@) SET(CTK_PLUGIN_LIBRARIES ${CTK_PLUGIN_LIBRARIES} @my_plugin_targets@) SET(BLUEBERRY_PLUGIN_PROVISIONING_FILE "@BLUEBERRY_PROVISIONING_FILE@") SET(BLUEBERRY_DOXYGEN_TAGFILE_NAME @BLUEBERRY_DOXYGEN_TAGFILE_NAME@) SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "@BLUEBERRY_SOURCE_DIR@/CMake") FIND_PACKAGE(Poco REQUIRED) SET(mbilog_DIR "@mbilog_DIR@") FIND_PACKAGE(mbilog REQUIRED) INCLUDE(MacroParseArguments) INCLUDE(MacroConvertSchema) INCLUDE(MacroOrganizeSources) INCLUDE(berryPluginHelpers) INCLUDE(MacroCollectPlugins) INCLUDE(MacroParseManifest) INCLUDE(MacroCreatePlugin) INCLUDE(MacroCreateQtHelp) INCLUDE(MacroInstallPlugin) INCLUDE(MacroInstallThirdPartyPlugins) -INCLUDE(FunctionCreateProvisioningInfo) +INCLUDE(FunctionCreateProvisioningFile) diff --git a/BlueBerry/Bundles/org.blueberry.osgi/src/internal/berryProvisioningInfo.cpp b/BlueBerry/Bundles/org.blueberry.osgi/src/internal/berryProvisioningInfo.cpp index 94c9b2a4cd..21a59b4ec5 100644 --- a/BlueBerry/Bundles/org.blueberry.osgi/src/internal/berryProvisioningInfo.cpp +++ b/BlueBerry/Bundles/org.blueberry.osgi/src/internal/berryProvisioningInfo.cpp @@ -1,199 +1,218 @@ /*========================================================================= Program: BlueBerry Platform Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "berryProvisioningInfo.h" #include #include #include #include +#include namespace berry { #ifdef CMAKE_INTDIR const QString ProvisioningInfo::intermediateOutDir = QString(CMAKE_INTDIR); #else const QString ProvisioningInfo::intermediateOutDir = QString(); #endif ProvisioningInfo::ProvisioningInfo(const QString& file) { this->readProvisioningFile(file); } QStringList ProvisioningInfo::getPluginDirs() const { return pluginDirs.toList(); } QList ProvisioningInfo::getPluginsToInstall() const { return pluginsToInstall; } QList ProvisioningInfo::getPluginsToStart() const { return pluginsToStart; } void ProvisioningInfo::readProvisioningFile(const QString& filePath) { QFile file(filePath); file.open(QFile::ReadOnly); QTextStream fileStream(&file); QRegExp sep("\\s+"); QString line; int count = 1; do { line = fileStream.readLine().trimmed(); if (!line.isEmpty() && !line.startsWith('#')) { QString keyword = line.section(sep, 0, 0); QString value = line.mid(keyword.size()).trimmed(); + value = substituteKeywords(value); if (keyword.isEmpty()) { BERRY_WARN << "Keyword missing in line " << count << " of provisioning file " << filePath.toStdString(); continue; } Keyword key = UNKNOWN; if (keyword.compare("READ", Qt::CaseInsensitive) == 0) { key = READ; } else if (keyword.compare("INSTALL", Qt::CaseInsensitive) == 0) { key = INSTALL; } else if (keyword.compare("START", Qt::CaseInsensitive) == 0) { key = START; } else if (keyword.compare("STOP", Qt::CaseInsensitive) == 0) { key = STOP; } if (key == UNKNOWN) { BERRY_WARN << "Keyword " << keyword.toStdString() << " in line " << count << " of provisioning file " << filePath.toStdString() << " unknown"; continue; } if (value.isEmpty()) { BERRY_WARN << "Value after keyword " << keyword.toStdString() << " missing in line " << count << " of provisioning file " << filePath.toStdString(); continue; } switch (key) { case READ: { QUrl readFileUrl(value); if (!readFileUrl.isValid()) { BERRY_WARN << "The READ URL " << value.toStdString() << "is invalid: " << readFileUrl.errorString().toStdString(); break; } this->readProvisioningFile(readFileUrl.toLocalFile()); break; } case INSTALL: { this->addPluginToInstall(value); break; } case START: { this->addPluginToStart(value); break; } case STOP: { break; } } } ++count; } while (!line.isNull()); } QUrl ProvisioningInfo::addPluginToInstall(const QString& file) { QUrl pluginUrl(file); if (!pluginUrl.isValid()) { BERRY_WARN << "The plugin URL " << file.toStdString() << " is invalid:" << pluginUrl.errorString().toStdString(); return QUrl(); } QFileInfo fileInfo(pluginUrl.toLocalFile()); if (!fileInfo.exists()) { QString fileName = fileInfo.fileName(); QString filePath = fileInfo.absolutePath(); if (!intermediateOutDir.isEmpty()) { // search in the intermediate output dir QString filePath2 = filePath + "/" + intermediateOutDir; fileInfo = QFileInfo(filePath2 + "/" + fileName); if (!fileInfo.exists()) { BERRY_WARN << "The plugin " << fileName.toStdString() << " was not found in " << filePath.toStdString() << " or " << filePath2.toStdString(); return QUrl(); } pluginUrl = QUrl::fromLocalFile(fileInfo.canonicalFilePath()); pluginDirs.insert(fileInfo.canonicalPath()); } else { BERRY_WARN << "The plugin " << fileName.toStdString() << " was not found in " << filePath.toStdString(); return QUrl(); } } else { pluginDirs.insert(fileInfo.canonicalPath()); } pluginsToInstall.append(pluginUrl); return pluginUrl; } void ProvisioningInfo::addPluginToStart(const QString& file) { QUrl pluginUrl = this->addPluginToInstall(file); if (!pluginUrl.isEmpty()) { pluginsToStart.append(pluginUrl); } } +QString ProvisioningInfo::substituteKeywords(const QString& value) const +{ + QString appPath = QCoreApplication::applicationDirPath(); + if (appPath.endsWith('/')) + { + appPath.chop(1); + } + +#ifdef CMAKE_INTDIR + // Strip the intermediate dir from the application path + QString intDir(CMAKE_INTDIR); + appPath.chop(intDir.size()+1); +#endif + + return QString(value).replace("@EXECUTABLE_DIR", appPath, Qt::CaseInsensitive); +} + } diff --git a/BlueBerry/Bundles/org.blueberry.osgi/src/internal/berryProvisioningInfo.h b/BlueBerry/Bundles/org.blueberry.osgi/src/internal/berryProvisioningInfo.h index 9f472f913f..18715c8770 100644 --- a/BlueBerry/Bundles/org.blueberry.osgi/src/internal/berryProvisioningInfo.h +++ b/BlueBerry/Bundles/org.blueberry.osgi/src/internal/berryProvisioningInfo.h @@ -1,61 +1,63 @@ /*========================================================================= Program: BlueBerry Platform Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef BERRYPROVISIONINGINFO_H #define BERRYPROVISIONINGINFO_H #include #include #include #include namespace berry { class ProvisioningInfo { public: ProvisioningInfo(const QString& file); QStringList getPluginDirs() const; QList getPluginsToInstall() const; QList getPluginsToStart() const; private: enum Keyword { UNKNOWN, READ, INSTALL, START, STOP }; QSet pluginDirs; QList pluginsToInstall; QList pluginsToStart; static const QString intermediateOutDir; void readProvisioningFile(const QString& file); QUrl addPluginToInstall(const QString& file); void addPluginToStart(const QString& file); + + QString substituteKeywords(const QString& value) const; }; } #endif // BERRYPROVISIONINGINFO_H diff --git a/BlueBerry/CMake/FunctionCreateProvisioningInfo.cmake b/BlueBerry/CMake/FunctionCreateProvisioningFile.cmake similarity index 50% rename from BlueBerry/CMake/FunctionCreateProvisioningInfo.cmake rename to BlueBerry/CMake/FunctionCreateProvisioningFile.cmake index 0ea92a305e..814781ce42 100644 --- a/BlueBerry/CMake/FunctionCreateProvisioningInfo.cmake +++ b/BlueBerry/CMake/FunctionCreateProvisioningFile.cmake @@ -1,37 +1,47 @@ -function(FunctionCreateProvisioningInfo) +function(FunctionCreateProvisioningFile) - macro_parse_arguments(_PROV "OUTPUT;INCLUDE;PLUGIN_DIR;PLUGINS" "" ${ARGN}) + macro_parse_arguments(_PROV "FILE;INCLUDE;PLUGIN_DIR;PLUGINS" "" ${ARGN}) set(out_var ) + set(out_var_install ) if(WIN32) set(file_url "file:///") else() set(file_url "file://") endif() foreach(incl ${_PROV_INCLUDE}) + string(REPLACE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" "@EXECUTABLE_DIR" incl_install ${incl}) set(out_var "${out_var}READ ${file_url}${incl}\n") + set(out_var_install "${out_var_install}READ ${file_url}${incl_install}\n") endforeach() if(_PROV_INCLUDE) set(out_var "${out_var}\n") + set(out_var_install "${out_var_install}\n") endif() + + string(REPLACE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" "@EXECUTABLE_DIR" _PROV_PLUGIN_DIR_install ${_PROV_PLUGIN_DIR}) foreach(plugin ${_PROV_PLUGINS}) ctkFunctionExtractOptionNameAndValue(${plugin} plugin_name_with_dirs plugin_value) string(REPLACE "/" ";" _tokens ${plugin_name_with_dirs}) list(GET _tokens -1 plugin_name) string(REPLACE "." "_" plugin_target ${plugin_name}) set(plugin_url "${file_url}${_PROV_PLUGIN_DIR}/lib${plugin_target}${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(plugin_url_install "${file_url}${_PROV_PLUGIN_DIR_install}/lib${plugin_target}${CMAKE_SHARED_LIBRARY_SUFFIX}") if(${${plugin_name_with_dirs}_option_name}) set(out_var "${out_var}START ${plugin_url}\n") + set(out_var_install "${out_var_install}START ${plugin_url_install}\n") #else() # set(out_var "${out_var}STOP ${plugin_url}\n") + # set(out_var_install "${out_var_install}STOP ${plugin_url_install}\n") endif() endforeach() - set(${_PROV_OUTPUT} ${out_var} PARENT_SCOPE) + file(WRITE ${_PROV_FILE} "${out_var}") + file(WRITE ${_PROV_FILE}.install "${out_var_install}") endfunction() diff --git a/BlueBerry/CMakeLists.txt b/BlueBerry/CMakeLists.txt index e9e421edad..ccaaa8031b 100644 --- a/BlueBerry/CMakeLists.txt +++ b/BlueBerry/CMakeLists.txt @@ -1,307 +1,305 @@ PROJECT(BlueBerry) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2) SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMake/") INCLUDE(MacroParseArguments) INCLUDE(MacroConvertSchema) INCLUDE(MacroOrganizeSources) INCLUDE(berryPluginHelpers) INCLUDE(MacroCollectPlugins) INCLUDE(MacroParseManifest) INCLUDE(MacroCreatePlugin) INCLUDE(MacroCreateCTKPlugin) INCLUDE(MacroCreateQtHelp) INCLUDE(MacroInstallPlugin) INCLUDE(MacroInstallCTKPlugin) -INCLUDE(FunctionCreateProvisioningInfo) +INCLUDE(FunctionCreateProvisioningFile) OPTION(BLUEBERRY_INSTALL_RPATH_RELATIVE "Use relative rpath entries when installing" OFF) MARK_AS_ADVANCED(BLUEBERRY_INSTALL_RPATH_RELATIVE) IF(BLUEBERRY_INSTALL_RPATH_RELATIVE) SET(CMAKE_INSTALL_RPATH ".") ELSE() SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/bin") ENDIF() IF(MSVC) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4275 /wd4251 /wd4503") ENDIF() IF (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) ENDIF () FIND_PACKAGE(mbilog REQUIRED) INCLUDE_DIRECTORIES(${mbilog_INCLUDE_DIRS}) OPTION(BLUEBERRY_USE_QT "Use the Qt GUI toolkit" OFF) IF(NOT DESIRED_QT_VERSION) SET(DESIRED_QT_VERSION 4 CACHE STRING "Desired Qt version" FORCE) MARK_AS_ADVANCED(DESIRED_QT_VERSION) ENDIF() IF(BLUEBERRY_USE_QT AND NOT DESIRED_QT_VERSION EQUAL 4) MESSAGE("Attention: Qt4 GUI libraries are required to build the BlueBerry Qt plug-ins.") ENDIF() IF(BLUEBERRY_USE_QT AND DESIRED_QT_VERSION EQUAL 4) SET(BUILD_QT_PLUGINS 1) FIND_PACKAGE(Qt4 4.6.2 REQUIRED) IF(QT_QMAKE_CHANGED) SET(QT_HELPGENERATOR_EXECUTABLE NOTFOUND) SET(QT_COLLECTIONGENERATOR_EXECUTABLE NOTFOUND) SET(QT_ASSISTANT_EXECUTABLE NOTFOUND) ENDIF() FIND_PROGRAM(QT_HELPGENERATOR_EXECUTABLE NAMES qhelpgenerator qhelpgenerator-qt4 qhelpgenerator4 PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH ) FIND_PROGRAM(QT_COLLECTIONGENERATOR_EXECUTABLE NAMES qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator4 PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH ) FIND_PROGRAM(QT_ASSISTANT_EXECUTABLE NAMES assistant-qt4 assistant4 assistant PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH ) OPTION(BLUEBERRY_USE_QT_HELP "Enable support for integrating bundle documentation into Qt Help" ON) MARK_AS_ADVANCED(BLUEBERRY_USE_QT_HELP QT_HELPGENERATOR_EXECUTABLE QT_COLLECTIONGENERATOR_EXECUTABLE QT_ASSISTANT_EXECUTABLE) SET(_doxygen_too_old 1) IF(BLUEBERRY_USE_QT_HELP) FIND_PACKAGE(Doxygen) IF(DOXYGEN_FOUND) EXECUTE_PROCESS(COMMAND ${DOXYGEN_EXECUTABLE} --version OUTPUT_VARIABLE _doxygen_version) IF(${_doxygen_version} VERSION_GREATER 1.6.0 OR ${_doxygen_version} VERSION_EQUAL 1.6.0) SET(_doxygen_too_old 0) ENDIF() ENDIF() ELSE(BLUEBERRY_USE_QT_HELP) CONFIGURE_FILE(../Documentation/pregenerated/MITKBlankPage.qch ${MITK_BINARY_DIR}/bin/ExtBundles/org.mitk.gui.qt.extapplication/resources/MITKBlankPage.qch COPYONLY) CONFIGURE_FILE(../Documentation/pregenerated/MitkExtQtHelpCollection.qhc ${MITK_BINARY_DIR}/bin/ExtBundles/org.mitk.gui.qt.extapplication/resources/MitkExtQtHelpCollection.qhc COPYONLY) ENDIF(BLUEBERRY_USE_QT_HELP) IF (BLUEBERRY_USE_QT_HELP AND _doxygen_too_old) MESSAGE("Doxygen was not found or is too old. Version 1.6.0 or later is needed if BLUEBERRY_USE_QT_HELP is ON") SET(BLUEBERRY_USE_QT_HELP OFF CACHE BOOL "Enable support for integrating bundle documentation into Qt Help" FORCE) ENDIF() IF(BLUEBERRY_USE_QT_HELP AND NOT QT_HELPGENERATOR_EXECUTABLE) MESSAGE("You have enabled Qt Help support, but QT_HELPGENERATOR_EXECUTABLE is empty") SET(BLUEBERRY_USE_QT_HELP OFF CACHE BOOL "Enable support for integrating bundle documentation into Qt Help" FORCE) ENDIF() INCLUDE(${QT_USE_FILE}) ELSE() FIND_PACKAGE(Qt4 4.6.2 COMPONENTS QtCore REQUIRED) INCLUDE(${QT_USE_FILE}) ENDIF() # ========= CTK specific CMake stuff ============ CMAKE_POLICY(SET CMP0012 NEW) FIND_PACKAGE(CTK REQUIRED) SET(CTK_PLUGIN_LIBRARIES "${CTK_PLUGIN_LIBRARIES}" CACHE INTERNAL "CTK plugins" FORCE) # Extract all library names starting with org_blueberry_ MACRO(GetMyTargetLibraries all_target_libraries varname) SET(re_ctkplugin "^org_blueberry_[a-zA-Z0-9_]+$") SET(_tmp_list) LIST(APPEND _tmp_list ${all_target_libraries}) ctkMacroListFilter(_tmp_list re_ctkplugin OUTPUT_VARIABLE ${varname}) ENDMACRO() # ================================================ OPTION(BLUEBERRY_BUILD_ALL_PLUGINS "Build all BlueBerry plugins (overriding selection)" OFF) MARK_AS_ADVANCED(BLUEBERRY_BUILD_ALL_PLUGINS) IF(BLUEBERRY_BUILD_ALL_PLUGINS) SET(BLUEBERRY_BUILD_ALL_PLUGINS_OPTION "FORCE_BUILD_ALL") ENDIF() OPTION(BLUEBERRY_STATIC "Build all plugins as static libraries" OFF) MARK_AS_ADVANCED(BLUEBERRY_STATIC) OPTION(BLUEBERRY_DEBUG_SMARTPOINTER "Enable code for debugging smart pointers" OFF) MARK_AS_ADVANCED(BLUEBERRY_DEBUG_SMARTPOINTER) FIND_PACKAGE(Poco REQUIRED) FIND_PACKAGE(Ant) FIND_PACKAGE(Eclipse) SET(BLUEBERRY_SOURCE_DIR ${BlueBerry_SOURCE_DIR}) SET(BLUEBERRY_BINARY_DIR ${BlueBerry_BINARY_DIR}) SET(BLUEBERRY_PLUGINS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Bundles) SET(BLUEBERRY_PLUGINS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Bundles) SET(OSGI_APP solstice) SET(OSGI_UI_APP solstice_ui) # Force should be removed after everybody has configured their old binary tree SET(BLUEBERRY_PLUGINS_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/BlueBerry CACHE PATH "Directory where to build the BlueBerry Bundles" FORCE) MARK_AS_ADVANCED(BLUEBERRY_PLUGINS_OUTPUT_DIR) # Clear the cache variables SET(BLUEBERRY_PLUGIN_SOURCE_DIRS "" CACHE INTERNAL "List of base plugin source directories" FORCE) SET(BLUEBERRY_PLUGIN_BINARY_DIRS "" CACHE INTERNAL "List of base plugin binary directories" FORCE) IF (Eclipse_DIR) SET(BLUEBERRY_DOC_TOOLS_DIR "${Eclipse_DIR}" CACHE PATH "Directory containing additional tools needed for generating the documentation") ELSE () SET(BLUEBERRY_DOC_TOOLS_DIR "" CACHE PATH "Directory containing additional tools needed for generating the documentation") ENDIF () SET(BLUEBERRY_DEBUG_POSTFIX d) # Testing options OPTION(BLUEBERRY_BUILD_TESTING "Build the BlueBerry tests." ${BUILD_TESTING}) IF(WIN32) SET(_gui_testing_default "ON") ELSE() SET(_gui_testing_default "OFF") ENDIF() OPTION(BLUEBERRY_ENABLE_GUI_TESTING "Enable the BlueBerry GUI tests" ${_gui_testing_default}) MARK_AS_ADVANCED(BLUEBERRY_ENABLE_GUI_TESTING) IF(BLUEBERRY_BUILD_TESTING) ENABLE_TESTING() ENDIF() # Add CTK plugins SET(_ctk_plugins Bundles/org.blueberry.osgi:ON Bundles/org.blueberry.compat:ON Bundles/org.blueberry.core.runtime:ON Bundles/org.blueberry.core.expressions:ON Bundles/org.blueberry.solstice.common:ON Bundles/org.blueberry.core.commands:ON Bundles/org.blueberry.core.jobs:OFF Bundles/org.blueberry.ui:ON Bundles/org.blueberry.ui.qt:ON Bundles/org.blueberry.ui.qt.log:OFF Bundles/org.blueberry.ui.qt.objectinspector:OFF ) SET(_ctk_test_plugins ) SET(_ctk_plugins_include_dirs ${Poco_INCLUDE_DIRS} ) SET(_ctk_plugins_link_dirs ${Poco_LIBRARY_DIR} ) INCLUDE_DIRECTORIES(${_ctk_plugins_include_dirs}) LINK_DIRECTORIES(${_ctk_plugins_link_dirs}) IF(BLUEBERRY_BUILD_TESTING) INCLUDE(berryTestingHelpers) SET(BLUEBERRY_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${OSGI_APP}") GET_TARGET_PROPERTY(_is_macosx_bundle ${OSGI_APP} MACOSX_BUNDLE) IF(APPLE AND _is_macosx_bundle) SET(BLUEBERRY_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${OSGI_APP}.app/Contents/MacOS/${OSGI_APP}") ENDIF() LIST(APPEND _ctk_plugins Bundles/org.blueberry.test:ON Bundles/org.blueberry.uitest:ON ) SET(_ctk_test_plugins Testing/org.blueberry.core.runtime.tests:ON Testing/org.blueberry.osgi.tests:ON ) IF(BLUEBERRY_ENABLE_GUI_TESTING) LIST(APPEND _ctk_test_plugins Testing/org.blueberry.ui.tests:ON) SET(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${OSGI_UI_APP}") GET_TARGET_PROPERTY(_is_macosx_bundle ${OSGI_UI_APP} MACOSX_BUNDLE) IF(APPLE AND _is_macosx_bundle) SET(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${OSGI_UI_APP}.app/Contents/MacOS/${OSGI_UI_APP}") ENDIF() ENDIF() ENDIF() SET(BLUEBERRY_TESTING_PROVISIONING_FILE "${BlueBerry_BINARY_DIR}/BlueBerryTesting.provisioning") ADD_CUSTOM_TARGET(BlueBerry) ctkMacroSetupExternalPlugins(${_ctk_plugins} ${_ctk_test_plugins} BUILD_OPTION_PREFIX BLUEBERRY_BUILD_ BUILD_ALL ${BLUEBERRY_BUILD_ALL_PLUGINS} COMPACT_OPTIONS) -SET(BLUEBERRY_PROVISIONING_FILE "${BlueBerry_BINARY_DIR}/BlueBerry.provisioning") -FunctionCreateProvisioningInfo( - OUTPUT prov_info +SET(BLUEBERRY_PROVISIONING_FILE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/BlueBerry.provisioning") +FunctionCreateProvisioningFile( + FILE ${BLUEBERRY_PROVISIONING_FILE} PLUGIN_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins" PLUGINS ${_ctk_plugins} ) -file(WRITE "${BLUEBERRY_PROVISIONING_FILE}" "${prov_info}") -FunctionCreateProvisioningInfo( - OUTPUT prov_testing_info +FunctionCreateProvisioningFile( + FILE ${BLUEBERRY_TESTING_PROVISIONING_FILE} + INCLUDE ${BLUEBERRY_PROVISIONING_FILE} PLUGIN_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_plugins" PLUGINS ${_ctk_test_plugins} ) -file(WRITE "${BLUEBERRY_TESTING_PROVISIONING_FILE}" "${prov_info}\n${prov_testing_info}") - ctkMacroGetAllProjectTargetLibraries("${CTK_PLUGIN_LIBRARIES}" _enabled_plugin_targets) add_dependencies(BlueBerry ${_enabled_plugin_targets}) set_property(TARGET ${_enabled_plugin_targets} PROPERTY LABELS BlueBerry) SET(BB_PLUGIN_USE_FILE "${BlueBerry_BINARY_DIR}/BlueBerryPluginUseFile.cmake") ctkFunctionGeneratePluginUseFile(${BB_PLUGIN_USE_FILE}) # CTK Plugin Exports SET(BB_PLUGIN_EXPORTS_FILE "${CMAKE_CURRENT_BINARY_DIR}/BlueBerryPluginExports.cmake") GetMyTargetLibraries("${CTK_PLUGIN_LIBRARIES}" my_plugin_targets) SET(additional_export_targets mbilog PocoFoundation PocoUtil PocoXML) IF(BLUEBERRY_BUILD_TESTING) LIST(APPEND additional_export_targets CppUnit) ENDIF() export(TARGETS ${my_plugin_targets} ${additional_export_targets} FILE ${BB_PLUGIN_EXPORTS_FILE}) ADD_SUBDIRECTORY(Documentation) CONFIGURE_FILE(BlueBerryConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/BlueBerryConfig.cmake @ONLY) diff --git a/CMake/mitkFunctionInstallProvisioningFiles.cmake b/CMake/mitkFunctionInstallProvisioningFiles.cmake new file mode 100644 index 0000000000..62d442aaa4 --- /dev/null +++ b/CMake/mitkFunctionInstallProvisioningFiles.cmake @@ -0,0 +1,6 @@ +function(mitkFunctionInstallProvisioningFiles) + foreach(file ${ARGN}) + get_filename_component(file_name "${file}" NAME) + MITK_INSTALL(FILES ${file}.install RENAME "${file_name}") + endforeach() +endfunction() diff --git a/CMakeLists.txt b/CMakeLists.txt index 6efefe8e65..c7a89b7074 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,607 +1,606 @@ cmake_minimum_required(VERSION 2.8.2) #----------------------------------------------------------------------------- # Superbuild Option - Enabled by default #----------------------------------------------------------------------------- option(MITK_USE_SUPERBUILD "Build MITK and the projects it depends on via SuperBuild.cmake." ON) if(MITK_USE_SUPERBUILD) project(MITK-superbuild) set(MITK_SOURCE_DIR ${PROJECT_SOURCE_DIR}) set(MITK_BINARY_DIR ${PROJECT_BINARY_DIR}) else() project(MITK) endif() #----------------------------------------------------------------------------- # See http://cmake.org/cmake/help/cmake-2-8-docs.html#section_Policies for details #----------------------------------------------------------------------------- set(project_policies CMP0001 # NEW: CMAKE_BACKWARDS_COMPATIBILITY should no longer be used. CMP0002 # NEW: Logical target names must be globally unique. CMP0003 # NEW: Libraries linked via full path no longer produce linker search paths. CMP0004 # NEW: Libraries linked may NOT have leading or trailing whitespace. CMP0005 # NEW: Preprocessor definition values are now escaped automatically. CMP0006 # NEW: Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION. CMP0007 # NEW: List command no longer ignores empty elements. CMP0008 # NEW: Libraries linked by full-path must have a valid library file name. CMP0009 # NEW: FILE GLOB_RECURSE calls should not follow symlinks by default. CMP0010 # NEW: Bad variable reference syntax is an error. CMP0011 # NEW: Included scripts do automatic cmake_policy PUSH and POP. CMP0012 # NEW: if() recognizes numbers and boolean constants. CMP0013 # NEW: Duplicate binary directories are not allowed. CMP0014 # NEW: Input directories must have CMakeLists.txt ) foreach(policy ${project_policies}) if(POLICY ${policy}) cmake_policy(SET ${policy} NEW) endif() endforeach() #----------------------------------------------------------------------------- # Update CMake module path #------------------------------------------------------------------------------ set(CMAKE_MODULE_PATH ${MITK_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH} ) #----------------------------------------------------------------------------- # CMake Function(s) and Macro(s) #----------------------------------------------------------------------------- include(mitkMacroEmptyExternalProject) include(mitkFunctionGenerateProjectXml) #----------------------------------------------------------------------------- # Output directories. #----------------------------------------------------------------------------- foreach(type LIBRARY RUNTIME ARCHIVE) # Make sure the directory exists if(DEFINED MITK_CMAKE_${type}_OUTPUT_DIRECTORY AND NOT EXISTS ${MITK_CMAKE_${type}_OUTPUT_DIRECTORY}) message("Creating directory MITK_CMAKE_${type}_OUTPUT_DIRECTORY: ${MITK_CMAKE_${type}_OUTPUT_DIRECTORY}") file(MAKE_DIRECTORY "${MITK_CMAKE_${type}_OUTPUT_DIRECTORY}") endif() if(MITK_USE_SUPERBUILD) set(output_dir ${MITK_BINARY_DIR}/bin) if(NOT DEFINED MITK_CMAKE_${type}_OUTPUT_DIRECTORY) set(MITK_CMAKE_${type}_OUTPUT_DIRECTORY ${MITK_BINARY_DIR}/MITK-build/bin) endif() else() if(NOT DEFINED MITK_CMAKE_${type}_OUTPUT_DIRECTORY) SET(output_dir ${MITK_BINARY_DIR}/bin) else() SET(output_dir ${MITK_CMAKE_${type}_OUTPUT_DIRECTORY}) endif() endif() set(CMAKE_${type}_OUTPUT_DIRECTORY ${output_dir} CACHE INTERNAL "Single output directory for building all libraries.") mark_as_advanced(CMAKE_${type}_OUTPUT_DIRECTORY) endforeach() #----------------------------------------------------------------------------- # Additional MITK Options (also shown during superbuild) #----------------------------------------------------------------------------- option(BUILD_SHARED_LIBS "Build MITK with shared libraries" ON) option(WITH_COVERAGE "Enable/Disable coverage" OFF) option(BUILD_TESTING "Test the project" ON) # some targets in Utilities also depend on Qt. Use this option # to decide if they should be build option(MITK_USE_QT "Use Trolltech's Qt library" ON) if(MITK_USE_QT) # find the package at the very beginning, so that QT4_FOUND is available find_package(Qt4 4.6.0 REQUIRED) endif() option(MITK_INSTALL_RPATH_RELATIVE "Use relative rpath entries for installation packages" OFF) option(MITK_BUILD_ALL_PLUGINS "Build all MITK plugins" OFF) option(MITK_BUILD_TUTORIAL "Build the MITK tutorial" ON) option(MITK_USE_Boost "Use the Boost C++ library" OFF) option(MITK_USE_BLUEBERRY "Build the BlueBerry platform" ON) option(MITK_USE_CTK "Use CTK in MITK" ${MITK_USE_BLUEBERRY}) option(MITK_USE_DCMTK "EXEPERIMENTAL, superbuild only: Use DCMTK in MITK" OFF) option(MITK_USE_OpenCV "Use Intel's OpenCV library" OFF) mark_as_advanced(MITK_INSTALL_RPATH_RELATIVE MITK_BUILD_ALL_PLUGINS MITK_USE_CTK MITK_USE_DCMTK ) # consistency checks if(MITK_USE_BLUEBERRY AND NOT MITK_USE_CTK) MESSAGE(FATAL_ERROR "BlueBerry depends on CTK. Please set MITK_USE_CTK to ON.") endif() #----------------------------------------------------------------------------- # Additional CXX/C Flags #----------------------------------------------------------------------------- set(ADDITIONAL_C_FLAGS "" CACHE STRING "Additional C Flags") mark_as_advanced(ADDITIONAL_C_FLAGS) set(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX Flags") mark_as_advanced(ADDITIONAL_CXX_FLAGS) #----------------------------------------------------------------------------- # Project.xml #----------------------------------------------------------------------------- # A list of topologically ordered targets set(CTEST_PROJECT_SUBPROJECTS) if(MITK_USE_BLUEBERRY) list(APPEND CTEST_PROJECT_SUBPROJECTS BlueBerry) endif() list(APPEND CTEST_PROJECT_SUBPROJECTS MITK-Core MITK-CoreUI MITK-IGT MITK-ToF MITK-DTI MITK-Registration MITK-Modules # all modules not contained in a specific subproject MITK-Plugins # all plugins not contained in a specific subproject ) # Configure CTestConfigSubProject.cmake that could be used by CTest scripts configure_file(${MITK_SOURCE_DIR}/CTestConfigSubProject.cmake.in ${MITK_BINARY_DIR}/CTestConfigSubProject.cmake) if(CTEST_PROJECT_ADDITIONAL_TARGETS) # those targets will be executed at the end of the ctest driver script # and they also get their own subproject label set(subproject_list "${CTEST_PROJECT_SUBPROJECTS};${CTEST_PROJECT_ADDITIONAL_TARGETS}") else() set(subproject_list "${CTEST_PROJECT_SUBPROJECTS}") endif() # Generate Project.xml file expected by the CTest driver script mitkFunctionGenerateProjectXml(${MITK_BINARY_DIR} ${PROJECT_NAME} "${subproject_list}" ${MITK_USE_SUPERBUILD}) #----------------------------------------------------------------------------- # Superbuild script #----------------------------------------------------------------------------- if(MITK_USE_SUPERBUILD) include("${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild.cmake") return() endif() #***************************************************************************** #**************************** END OF SUPERBUILD **************************** #***************************************************************************** #----------------------------------------------------------------------------- # CMake Function(s) and Macro(s) #----------------------------------------------------------------------------- include(mitkFunctionCheckCompilerFlags) include(mitkFunctionGetGccVersion) include(MacroParseArguments) include(mitkFunctionSuppressWarnings) # includes several functions include(mitkFunctionOrganizeSources) include(mitkFunctionGetVersion) 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(mitkMacroGetLinuxDistribution) #----------------------------------------------------------------------------- # Prerequesites #----------------------------------------------------------------------------- find_package(ITK REQUIRED) find_package(VTK REQUIRED) #----------------------------------------------------------------------------- # Set MITK specific options and variables (NOT available during superbuild) #----------------------------------------------------------------------------- # ASK THE USER TO SHOW THE CONSOLE WINDOW FOR CoreApp and ExtApp option(MITK_SHOW_CONSOLE_WINDOW "Use this to enable or disable the console window when starting MITK GUI Applications" ON) mark_as_advanced(MITK_SHOW_CONSOLE_WINDOW) # TODO: check if necessary option(USE_ITKZLIB "Use the ITK zlib for pic compression." ON) mark_as_advanced(USE_ITKZLIB) #----------------------------------------------------------------------------- # Get MITK version info #----------------------------------------------------------------------------- mitkFunctionGetVersion(${MITK_SOURCE_DIR} MITK) #----------------------------------------------------------------------------- # Installation preparation # # These should be set before any MITK install macros are used #----------------------------------------------------------------------------- if(MITK_INSTALL_RPATH_RELATIVE) set(CMAKE_INSTALL_RPATH ".") else() set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/bin") endif() # on Mac OSX all BlueBerry plugins get copied into every # application bundle (.app directory) specified here if(APPLE) if(MITK_BUILD_org.mitk.gui.qt.extapplication) set(MACOSX_BUNDLE_NAMES ${MACOSX_BUNDLE_NAMES} ExtApp) endif() if(MITK_BUILD_org.mitk.gui.qt.application) set(MACOSX_BUNDLE_NAMES ${MACOSX_BUNDLE_NAMES} CoreApp) endif() endif(APPLE) #----------------------------------------------------------------------------- # Set symbol visibility Flags #----------------------------------------------------------------------------- # MinGW does not export all symbols automatically, so no need to set flags if(CMAKE_COMPILER_IS_GNUCXX AND NOT MINGW) set(VISIBILITY_CXX_FLAGS ) #"-fvisibility=hidden -fvisibility-inlines-hidden") endif() #----------------------------------------------------------------------------- # Set coverage Flags #----------------------------------------------------------------------------- if(WITH_COVERAGE) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") set(coverage_flags "-g -fprofile-arcs -ftest-coverage -O0 -DNDEBUG") set(COVERAGE_CXX_FLAGS ${coverage_flags}) set(COVERAGE_C_FLAGS ${coverage_flags}) endif() endif() #----------------------------------------------------------------------------- # MITK C/CXX Flags #----------------------------------------------------------------------------- set(MITK_C_FLAGS "${COVERAGE_C_FLAGS} ${ADDITIONAL_C_FLAGS}") set(MITK_CXX_FLAGS "${VISIBILITY_CXX_FLAGS} ${COVERAGE_CXX_FLAGS} ${ADDITIONAL_CXX_FLAGS}") if(CMAKE_COMPILER_IS_GNUCXX) set(cflags "-Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align -Wwrite-strings -D_FORTIFY_SOURCE=2") mitkFunctionCheckCompilerFlags("-fdiagnostics-show-option" cflags) mitkFunctionCheckCompilerFlags("-Wl,--no-undefined" cflags) mitkFunctionGetGccVersion(${CMAKE_CXX_COMPILER} GCC_VERSION) # With older version of gcc supporting the flag -fstack-protector-all, an extra dependency to libssp.so # is introduced. If gcc is smaller than 4.4.0 and the build type is Release let's not include the flag. # Doing so should allow to build package made for distribution using older linux distro. if(${GCC_VERSION} VERSION_GREATER "4.4.0" OR (CMAKE_BUILD_TYPE STREQUAL "Debug" AND ${GCC_VERSION} VERSION_LESS "4.4.0")) mitkFunctionCheckCompilerFlags("-fstack-protector-all" cflags) endif() if(MINGW) # suppress warnings about auto imported symbols set(MITK_CXX_FLAGS "-Wl,--enable-auto-import ${MITK_CXX_FLAGS}") # we need to define a Windows version set(MITK_CXX_FLAGS "-D_WIN32_WINNT=0x0500 ${MITK_CXX_FLAGS}") endif() set(MITK_C_FLAGS "${cflags} ${MITK_C_FLAGS}") #set(MITK_CXX_FLAGS "${cflags} -Woverloaded-virtual -Wold-style-cast -Wstrict-null-sentinel -Wsign-promo ${MITK_CXX_FLAGS}") set(MITK_CXX_FLAGS "${cflags} -Woverloaded-virtual -Wstrict-null-sentinel ${MITK_CXX_FLAGS}") endif() #----------------------------------------------------------------------------- # MITK Modules #----------------------------------------------------------------------------- set(MITK_MODULES_CONF_DIR ${MITK_BINARY_DIR}/modulesConf CACHE INTERNAL "Modules Conf") set(MITK_MODULES_PACKAGE_DEPENDS_DIR ${MITK_SOURCE_DIR}/CMake/PackageDepends) set(MODULES_PACKAGE_DEPENDS_DIRS ${MITK_MODULES_PACKAGE_DEPENDS_DIR}) #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if(BUILD_TESTING) enable_testing() include(CTest) mark_as_advanced(TCL_TCLSH DART_ROOT) option(MITK_ENABLE_GUI_TESTING OFF "Enable the MITK GUI tests") # Setup file for setting custom ctest vars configure_file( CMake/CTestCustom.cmake.in ${MITK_BINARY_DIR}/CTestCustom.cmake @ONLY ) # Configuration for the CMake-generated test driver set(CMAKE_TESTDRIVER_EXTRA_INCLUDES "#include ") set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN " try {") set(CMAKE_TESTDRIVER_AFTER_TESTMAIN " } catch( std::exception & excp ) { fprintf(stderr,\"%s\\n\",excp.what()); return EXIT_FAILURE; } catch( ... ) { printf(\"Exception caught in the test driver\\n\"); return EXIT_FAILURE; } ") set(MITK_TEST_OUTPUT_DIR "${MITK_BINARY_DIR}/test_output") if(NOT EXISTS ${MITK_TEST_OUTPUT_DIR}) file(MAKE_DIRECTORY ${MITK_TEST_OUTPUT_DIR}) endif() endif() configure_file(mitkTestingConfig.h.in ${MITK_BINARY_DIR}/mitkTestingConfig.h) #----------------------------------------------------------------------------- # MITK_SUPERBUILD_BINARY_DIR #----------------------------------------------------------------------------- # If MITK_SUPERBUILD_BINARY_DIR isn't defined, it means MITK is *NOT* build using Superbuild. # In that specific case, MITK_SUPERBUILD_BINARY_DIR should default to MITK_BINARY_DIR if(NOT DEFINED MITK_SUPERBUILD_BINARY_DIR) set(MITK_SUPERBUILD_BINARY_DIR ${MITK_BINARY_DIR}) endif() #----------------------------------------------------------------------------- # Compile Utilities and set-up MITK variables #----------------------------------------------------------------------------- add_subdirectory(Utilities) include(mitkSetupVariables) if(MITK_USE_BLUEBERRY) include(mitkSetupBlueBerry) endif() #----------------------------------------------------------------------------- # Set C/CXX Flags for MITK code #----------------------------------------------------------------------------- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MITK_CXX_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MITK_C_FLAGS}") if(MITK_USE_QT) add_definitions(-DQWT_DLL) endif() #----------------------------------------------------------------------------- # Add custom targets representing CDash subprojects #----------------------------------------------------------------------------- foreach(subproject ${CTEST_PROJECT_SUBPROJECTS}) if(NOT TARGET ${subproject}) add_custom_target(${subproject}) endif() endforeach() #----------------------------------------------------------------------------- # Add subdirectories #----------------------------------------------------------------------------- link_directories(${MITK_LINK_DIRECTORIES}) add_subdirectory(Core) if(MITK_USE_QT AND QT4_FOUND) add_subdirectory(CoreUI/Qmitk) endif() add_subdirectory(Modules) if(MITK_USE_BLUEBERRY) set(MITK_DEFAULT_SUBPROJECTS MITK-Plugins) include("${CMAKE_CURRENT_SOURCE_DIR}/CoreUI/Bundles/PluginList.cmake") set(mitk_core_plugins_fullpath ) foreach(core_plugin ${MITK_CORE_PLUGINS}) list(APPEND mitk_core_plugins_fullpath CoreUI/Bundles/${core_plugin}) endforeach() if(BUILD_TESTING) include(berryTestingHelpers) include("${CMAKE_CURRENT_SOURCE_DIR}/CoreUI/BundleTesting/PluginList.cmake") set(mitk_core_test_plugins_fullpath ) foreach(core_test_plugin ${MITK_CORE_TEST_PLUGINS}) list(APPEND mitk_core_test_plugins_fullpath CoreUI/BundleTesting/${core_test_plugin}) endforeach() set(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp") get_target_property(_is_macosx_bundle CoreApp MACOSX_BUNDLE) if(APPLE AND _is_macosx_bundle) set(BLUEBERRY_UI_TEST_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp.app/Contents/MacOS/CoreApp") endif() set(BLUEBERRY_TEST_APP_ID "org.mitk.qt.application") endif() include("${CMAKE_CURRENT_SOURCE_DIR}/Modules/Bundles/PluginList.cmake") set(mitk_ext_plugins_fullpath ) foreach(ext_plugin ${MITK_EXT_PLUGINS}) list(APPEND mitk_ext_plugins_fullpath Modules/Bundles/${ext_plugin}) endforeach() ctkMacroSetupExternalPlugins(${mitk_core_plugins_fullpath} ${mitk_core_test_plugins_fullpath} ${mitk_ext_plugins_fullpath} BUILD_OPTION_PREFIX MITK_BUILD_ BUILD_ALL ${MITK_BUILD_ALL_PLUGINS} COMPACT_OPTIONS) ctkFunctionExtractPluginTargets("${mitk_core_plugins_fullpath}" ON MITK_CORE_ENABLED_PLUGINS) ctkFunctionExtractPluginTargets("${mitk_ext_plugins_fullpath}" ON MITK_EXT_ENABLED_PLUGINS) list(APPEND MITK_EXT_ENABLED_PLUGINS ${MITK_CORE_ENABLED_PLUGINS}) set(MITK_COREAPP_PROVISIONING_FILE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp.provisioning") - FunctionCreateProvisioningInfo( - OUTPUT prov_info + FunctionCreateProvisioningFile( + FILE ${MITK_COREAPP_PROVISIONING_FILE} INCLUDE "${BLUEBERRY_PLUGIN_PROVISIONING_FILE}" PLUGIN_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins" PLUGINS ${mitk_core_plugins_fullpath} ) - file(WRITE "${MITK_COREAPP_PROVISIONING_FILE}" "${prov_info}") set(MITK_EXTAPP_PROVISIONING_FILE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ExtApp.provisioning") - FunctionCreateProvisioningInfo( - OUTPUT prov_info - INCLUDE "${MITK_COREAPP_PROVISIONING_FILE}" + FunctionCreateProvisioningFile( + FILE ${MITK_EXTAPP_PROVISIONING_FILE} + INCLUDE "${BLUEBERRY_PLUGIN_PROVISIONING_FILE}" PLUGIN_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins" - PLUGINS ${mitk_ext_plugins_fullpath} + PLUGINS ${mitk_core_plugins_fullpath} ${mitk_ext_plugins_fullpath} ) - file(WRITE "${MITK_EXTAPP_PROVISIONING_FILE}" "${prov_info}") set(MITK_PLUGIN_USE_FILE "${MITK_BINARY_DIR}/MitkPluginUseFile.cmake") ctkFunctionGeneratePluginUseFile(${MITK_PLUGIN_USE_FILE}) # Used in the export command further below GetMyTargetLibraries("${CTK_PLUGIN_LIBRARIES}" MITK_PLUGIN_TARGETS) # add legacy BlueBerry bundles add_subdirectory(Modules/Bundles) endif() # Construct a list of paths containing runtime directories # for MITK applications on Windows set(MITK_RUNTIME_PATH "${VTK_LIBRARY_DIRS}/@VS_BUILD_TYPE@;${ITK_LIBRARY_DIRS}/@VS_BUILD_TYPE@;${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/@VS_BUILD_TYPE@" ) if(QT4_FOUND) set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${QT_LIBRARY_DIR}/../bin") endif() if(MITK_USE_BLUEBERRY) set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${CTK_RUNTIME_LIBRARY_DIRS}/@VS_BUILD_TYPE@;${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins/@VS_BUILD_TYPE@") endif() if(GDCM_DIR) set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${GDCM_DIR}/bin/@VS_BUILD_TYPE@") endif() if(OpenCV_DIR) set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${OpenCV_DIR}/bin/@VS_BUILD_TYPE@") endif() # DCMTK is statically build #if(DCMTK_DIR) # set(MITK_RUNTIME_PATH "${MITK_RUNTIME_PATH};${DCMTK_DIR}/bin/@VS_BUILD_TYPE@") #endif() # Add applications directory add_subdirectory(Applications) #----------------------------------------------------------------------------- # Python Wrapping #----------------------------------------------------------------------------- set(MITK_WRAPPING_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Wrapping) set(MITK_WRAPPING_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Wrapping) option(MITK_USE_PYTHON "Build cswig Python wrapper support (requires CableSwig)." OFF) if(MITK_USE_PYTHON) add_subdirectory(Wrapping) endif() #----------------------------------------------------------------------------- # Documentation #----------------------------------------------------------------------------- add_subdirectory(Documentation) #----------------------------------------------------------------------------- # Installation #----------------------------------------------------------------------------- # set MITK cpack variables include(mitkSetupCPack) if(MITK_BUILD_org.mitk.gui.qt.application) list(APPEND CPACK_CREATE_DESKTOP_LINKS "CoreApp") endif() if(MITK_BUILD_org.mitk.gui.qt.extapplication) list(APPEND CPACK_CREATE_DESKTOP_LINKS "ExtApp") endif() configure_file(${MITK_SOURCE_DIR}/MITKCPackOptions.cmake.in ${MITK_BINARY_DIR}/MITKCPackOptions.cmake @ONLY) set(CPACK_PROJECT_CONFIG_FILE "${MITK_BINARY_DIR}/MITKCPackOptions.cmake") # include CPack model once all variables are set include(CPack) # Additional installation rules include(mitkInstallRules) #----------------------------------------------------------------------------- # Last configuration steps #----------------------------------------------------------------------------- set(MITK_EXPORTS_FILE "${MITK_BINARY_DIR}/MitkExports.cmake") file(REMOVE ${MITK_EXPORTS_FILE}) if(MITK_USE_BLUEBERRY) set(enabled_plugins ${BLUEBERRY_PLUGIN_TARGETS} ${MITK_PLUGIN_TARGETS} ${MITK_MODULES_ENABLED_PLUGINS} ) # This is for installation support of external projects depending on # MITK plugins. The export file should not be used for linking to MITK # libraries without using LINK_DIRECTORIES, since the exports are incomplete # yet(depending libraries are not exported). foreach(plugin ${enabled_plugins}) string(REPLACE "." "_" plugin_target ${plugin}) export(TARGETS ${plugin_target} APPEND FILE ${MITK_EXPORTS_FILE}) endforeach() endif() configure_file(${MITK_SOURCE_DIR}/CMake/ToolExtensionITKFactory.cpp.in ${MITK_BINARY_DIR}/ToolExtensionITKFactory.cpp.in COPYONLY) configure_file(${MITK_SOURCE_DIR}/CMake/ToolExtensionITKFactoryLoader.cpp.in ${MITK_BINARY_DIR}/ToolExtensionITKFactoryLoader.cpp.in COPYONLY) configure_file(${MITK_SOURCE_DIR}/CMake/ToolGUIExtensionITKFactory.cpp.in ${MITK_BINARY_DIR}/ToolGUIExtensionITKFactory.cpp.in COPYONLY) configure_file(mitkVersion.h.in ${MITK_BINARY_DIR}/mitkVersion.h) configure_file(mitkConfig.h.in ${MITK_BINARY_DIR}/mitkConfig.h) set(VECMATH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/vecmath) set(IPFUNC_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/ipFunc) set(UTILITIES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities) configure_file(mitkConfig.h.in ${MITK_BINARY_DIR}/mitkConfig.h) configure_file(MITKConfig.cmake.in ${MITK_BINARY_DIR}/MITKConfig.cmake @ONLY) # If we are under Windows, create two batch files which correctly # set up the environment for the application and for Visual Studio if(WIN32) include(mitkFunctionCreateWindowsBatchScript) set(VS_SOLUTION_FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}.sln") foreach(VS_BUILD_TYPE debug release) mitkFunctionCreateWindowsBatchScript("${MITK_SOURCE_DIR}/CMake/StartVS.bat.in" ${PROJECT_BINARY_DIR}/StartVS_${VS_BUILD_TYPE}.bat ${VS_BUILD_TYPE}) endforeach() endif(WIN32) diff --git a/MITKConfig.cmake.in b/MITKConfig.cmake.in index 55201d4460..2557a3ff4b 100644 --- a/MITKConfig.cmake.in +++ b/MITKConfig.cmake.in @@ -1,125 +1,129 @@ # 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) # 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(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@") # 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_INSTALL_RPATH_RELATIVE @MITK_INSTALL_RPATH_RELATIVE@) 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) SET(MITK_EXPORTS_FILE_INCLUDED 1) INCLUDE("@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_PROVISIOING_FILE}" + "${MITK_PLUGIN_PROVISIONING_FILE}") ENDIF(MITK_USE_BLUEBERRY)