diff --git a/CMakeLists.txt b/CMakeLists.txt index bb2a90c4b0..8bb39abf5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,524 +1,525 @@ cmake_minimum_required(VERSION 2.8.2) project(MITK) #----------------------------------------------------------------------------- # 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) #----------------------------------------------------------------------------- # Superbuild Option - Enabled by default #----------------------------------------------------------------------------- option(MITK_USE_SUPERBUILD "Build MITK and the projects it depends on via SuperBuild.cmake." ON) #----------------------------------------------------------------------------- # 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(FATAL_ERROR "MITK_CMAKE_${type}_OUTPUT_DIRECTORY is set to a non-existing 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_GDCMIO "Use the GDCMIO class instead of ImageIO2 for DICOM" ON) option(MITK_USE_BLUEBERRY "Build the BlueBerry platform" ON) option(MITK_USE_CTK "EXEPERIMENTAL, superbuild only: Use CTK in MITK" OFF) option(MITK_USE_DCMTK "EXEPERIMENTAL, superbuild only: Use DCMTK in MITK" OFF) mark_as_advanced(MITK_INSTALL_RPATH_RELATIVE MITK_BUILD_ALL_PLUGINS MITK_USE_CTK MITK_USE_DCMTK ) #----------------------------------------------------------------------------- # 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-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) # Generate Project.xml file expected by the CTest driver script mitkFunctionGenerateProjectXml(${MITK_BINARY_DIR} ${PROJECT_NAME} "${CTEST_PROJECT_SUBPROJECTS}" ${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(mitkMacroCreateModuleConf) include(mitkMacroCreateModule) include(mitkMacroCheckModule) include(mitkMacroCreateModuleTests) include(mitkMacroUseModule) include(mitkMacroMultiplexPicType) include(mitkMacroInstall) include(mitkMacroInstallHelperApp) include(mitkMacroInstallTargets) include(mitkMacroGenerateToolsLibrary) #----------------------------------------------------------------------------- # 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) #----------------------------------------------------------------------------- # 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 "${CMAKE_C_FLAGS} ${COVERAGE_C_FLAGS} ${ADDITIONAL_C_FLAGS}") set(MITK_CXX_FLAGS "${CMAKE_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() configure_file(mitkTestingConfig.h.in ${MITK_BINARY_DIR}/mitkTestingConfig.h) endif() #----------------------------------------------------------------------------- # 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 ${MITK_CXX_FLAGS}) set(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) set(MITK_DEFAULT_SUBPROJECTS MITK-CoreUI) if(MITK_USE_QT AND QT4_FOUND) add_subdirectory(CoreUI/Qmitk) endif() add_subdirectory(Modules) if(MITK_USE_BLUEBERRY) set(mitk_core_plugins CoreUI/Bundles/org.mitk.core.services:ON CoreUI/Bundles/org.mitk.gui.common:ON CoreUI/Bundles/org.mitk.gui.qt.common:ON CoreUI/Bundles/org.mitk.gui.qt.application:ON ) set(mitk_ext_plugins Modules/Bundles/org.mitk.core.ext:ON Modules/Bundles/org.mitk.core.jobs:OFF Modules/Bundles/org.mitk.diffusionimaging:OFF Modules/Bundles/org.mitk.gui.qt.diffusionimaging:OFF Modules/Bundles/org.mitk.gui.qt.ext:ON Modules/Bundles/org.mitk.gui.qt.extapplication:ON + Modules/Bundles/org.mitk.planarfigure:ON Modules/Bundles/org.mitk.gui.qt.datamanager:ON ) ctkMacroSetupExternalPlugins(${mitk_core_plugins} ${mitk_ext_plugins} BUILD_OPTION_PREFIX MITK_BUILD_ BUILD_ALL ${MITK_BUILD_ALL_PLUGINS} COMPACT_OPTIONS) set(MITK_COREAPP_PROVISIONING_FILE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/CoreApp.provisioning") if(EXISTS "${MITK_COREAPP_PROVISIONING_FILE}") file(REMOVE "${MITK_COREAPP_PROVISIONING_FILE}") endif() file(APPEND "${MITK_COREAPP_PROVISIONING_FILE}" "READ file://${BLUEBERRY_PLUGIN_PROVISIONING_FILE}\n") FunctionCreateProvisioningInfo(prov_info "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins" ${mitk_core_plugins}) file(APPEND "${MITK_COREAPP_PROVISIONING_FILE}" "${prov_info}") set(MITK_EXTAPP_PROVISIONING_FILE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ExtApp.provisioning") if(EXISTS "${MITK_EXTAPP_PROVISIONING_FILE}") file(REMOVE "${MITK_EXTAPP_PROVISIONING_FILE}") endif() file(APPEND "${MITK_EXTAPP_PROVISIONING_FILE}" "READ file://${MITK_COREAPP_PROVISIONING_FILE}\n") FunctionCreateProvisioningInfo(prov_info "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins" ${mitk_ext_plugins}) file(APPEND "${MITK_EXTAPP_PROVISIONING_FILE}" "${prov_info}") set(MITK_CORE_PLUGIN_USE_FILE "${MITK_BINARY_DIR}/MitkCorePluginUseFile.cmake") ctkFunctionGeneratePluginUseFile(${MITK_CORE_PLUGIN_USE_FILE}) endif() if(MITK_USE_BLUEBERRY) add_subdirectory(Modules/Bundles) endif() 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 #----------------------------------------------------------------------------- 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 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_ENABLED_PLUGINS} ${MITK_CORE_ENABLED_PLUGINS} ${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) diff --git a/Modules/Bundles/CMakeLists.txt b/Modules/Bundles/CMakeLists.txt index f643a90baa..d3af82d143 100644 --- a/Modules/Bundles/CMakeLists.txt +++ b/Modules/Bundles/CMakeLists.txt @@ -1,46 +1,47 @@ IF(MITK_USE_BLUEBERRY) # INCLUDE("${MITK_BINARY_DIR}/mitkExtConfig.cmake") # INCLUDE("${MITK_BINARY_DIR}/QmitkExtConfig.cmake") INCLUDE("${MITK_BINARY_DIR}/Bundles/MITKCoreBundleList.cmake") SET(MITK_DEFAULT_SUBPROJECTS MITK-Plugins) SET(_mitk_bundles_default "org.mitk.planarfigure" ) IF(QT4_FOUND) LIST(APPEND _mitk_bundles_default "org.mitk.gui.qt.ext" "org.mitk.gui.qt.extapplication") # ExtApp required bundles LIST(APPEND _mitk_bundles_default "org.mitk.gui.qt.imagenavigator" "org.mitk.gui.qt.datamanager") # BlueBerry depends on CTK which depends on Qt, so we # need the Qt include direcotries INCLUDE(${QT_USE_FILE}) ENDIF() SET(PLUGIN_EXCLUDE_LIST org.mitk.core.ext org.mitk.gui.qt.volumetry org.mitk.core.jobs org.mitk.diffusionimaging org.mitk.gui.qt.diffusionimaging org.mitk.gui.qt.ext org.mitk.gui.qt.extapplication org.mitk.gui.qt.datamanager + org.mitk.planarfigure ) MACRO_COLLECT_PLUGINS(OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ExtBundles CACHE_PLUGIN_SOURCE_DIRS MITK_MODULES_PLUGIN_SOURCE_DIRS CACHE_PLUGIN_OUTPUT_DIRS MITK_MODULES_PLUGIN_OUTPUT_DIRS CACHE_PLUGIN_TARGETS MITK_MODULES_ENABLED_PLUGINS BUNDLE_LIST_PATH "${MITK_BINARY_DIR}/Bundles/MITKModulesBundleList.cmake" CMAKE_CACHE_PREFIX "MITK" PLUGIN_DEFAULT_ON ${_mitk_bundles_default} PLUGIN_EXCLUDES ${PLUGIN_EXCLUDE_LIST} ${MITK_BUILD_ALL_PLUGINS_OPTION}) ENDIF(MITK_USE_BLUEBERRY) diff --git a/Modules/Bundles/org.mitk.planarfigure/CMakeLists.txt b/Modules/Bundles/org.mitk.planarfigure/CMakeLists.txt index 4dc39932f2..31bdd65aba 100644 --- a/Modules/Bundles/org.mitk.planarfigure/CMakeLists.txt +++ b/Modules/Bundles/org.mitk.planarfigure/CMakeLists.txt @@ -1,2 +1,7 @@ +PROJECT(org_mitk_planarfigure) -MACRO_CREATE_MITK_PLUGIN(PlanarFigure Qmitk) +MACRO_CREATE_MITK_CTK_PLUGIN( + EXPORT_DIRECTIVE ORG_MITK_PLANARFIGURE_EXPORT + EXPORTED_INCLUDE_SUFFIXES src + MODULE_DEPENDENCIES PlanarFigure Qmitk + ) diff --git a/Modules/Bundles/org.mitk.planarfigure/META-INF/MANIFEST.MF b/Modules/Bundles/org.mitk.planarfigure/META-INF/MANIFEST.MF deleted file mode 100644 index 3c8cf724fa..0000000000 --- a/Modules/Bundles/org.mitk.planarfigure/META-INF/MANIFEST.MF +++ /dev/null @@ -1,8 +0,0 @@ -Manifest-Version: 1.0 -Bundle-Name: MBI PlanarFigure -Bundle-SymbolicName: org.mitk.planarfigure -Bundle-Version: 0.1 -Bundle-Vendor: DKFZ, Medical and Biological Informatics -Require-Bundle: org.blueberry.osgi, org.blueberry.ui, org.mitk.gui.common -Bundle-Activator: mitk::PlanarFigureActivator -Bundle-ActivationPolicy: eager diff --git a/Modules/Bundles/org.mitk.planarfigure/files.cmake b/Modules/Bundles/org.mitk.planarfigure/files.cmake index 9521a7dc8c..b43ad1682a 100644 --- a/Modules/Bundles/org.mitk.planarfigure/files.cmake +++ b/Modules/Bundles/org.mitk.planarfigure/files.cmake @@ -1,18 +1,22 @@ +SET(MOC_H_FILES + src/internal/mitkPlanarFigureActivator.h +) + SET(SRC_CPP_FILES ) SET(INTERNAL_CPP_FILES mitkPlanarFigureActivator.cpp ) -SET(CPP_FILES manifest.cpp) +SET(CPP_FILES ) foreach(file ${SRC_CPP_FILES}) SET(CPP_FILES ${CPP_FILES} src/${file}) endforeach(file ${SRC_CPP_FILES}) foreach(file ${INTERNAL_CPP_FILES}) SET(CPP_FILES ${CPP_FILES} src/internal/${file}) endforeach(file ${INTERNAL_CPP_FILES}) diff --git a/Modules/Bundles/org.mitk.planarfigure/manifest.cpp b/Modules/Bundles/org.mitk.planarfigure/manifest.cpp deleted file mode 100644 index 015cc9fad8..0000000000 --- a/Modules/Bundles/org.mitk.planarfigure/manifest.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2009-07-14 19:11:20 +0200 (Tue, 14 Jul 2009) $ -Version: $Revision: 18127 $ - -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 - -#include -#include "src/internal/mitkPlanarFigureActivator.h" - -POCO_BEGIN_MANIFEST(berry::IBundleActivator) -POCO_EXPORT_CLASS(mitk::PlanarFigureActivator) -POCO_END_MANIFEST diff --git a/Modules/Bundles/org.mitk.planarfigure/manifest_headers.cmake b/Modules/Bundles/org.mitk.planarfigure/manifest_headers.cmake new file mode 100644 index 0000000000..ae4722d978 --- /dev/null +++ b/Modules/Bundles/org.mitk.planarfigure/manifest_headers.cmake @@ -0,0 +1,6 @@ +set(Plugin-Name "MBI PlanarFigure") +set(Plugin-Version "0.1") +set(Plugin-Vendor "DKFZ, Medical and Biological Informatics") +set(Plugin-ContactAddress "http://www.mitk.org") +set(Require-Plugin org.mitk.gui.common) +set(Plugin-ActivationPolicy eager) diff --git a/Modules/Bundles/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.cpp b/Modules/Bundles/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.cpp index 2acf4c00c5..95745581cf 100644 --- a/Modules/Bundles/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.cpp +++ b/Modules/Bundles/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.cpp @@ -1,63 +1,71 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-07-14 19:11:20 +0200 (Tue, 14 Jul 2009) $ Version: $Revision: 18127 $ 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 "mitkPlanarFigureActivator.h" #include "mitkPlanarFigureObjectFactory.h" #include "QmitkNodeDescriptorManager.h" #include "mitkNodePredicateDataType.h" #include "mitkNodePredicateProperty.h" #include "mitkNodePredicateAnd.h" +#include void -mitk::PlanarFigureActivator::Start(berry::IBundleContext::Pointer /*context*/) +mitk::PlanarFigureActivator::start(ctkPluginContext* /*context*/) { RegisterPlanarFigureObjectFactory(); QmitkNodeDescriptorManager* descriptorManager = QmitkNodeDescriptorManager::GetInstance(); // Adding "PlanarLine" mitk::NodePredicateDataType::Pointer isPlanarLine = mitk::NodePredicateDataType::New("PlanarLine"); descriptorManager->AddDescriptor(new QmitkNodeDescriptor(QObject::tr("PlanarLine"), QString(":/QmitkExt/PlanarLine_48.png"), isPlanarLine, descriptorManager)); // Adding "PlanarCircle" mitk::NodePredicateDataType::Pointer isPlanarCircle = mitk::NodePredicateDataType::New("PlanarCircle"); descriptorManager->AddDescriptor(new QmitkNodeDescriptor(QObject::tr("PlanarCircle"), QString(":/QmitkExt/PlanarCircle_48.png"), isPlanarCircle, descriptorManager)); // Adding "PlanarAngle" mitk::NodePredicateDataType::Pointer isPlanarAngle = mitk::NodePredicateDataType::New("PlanarAngle"); descriptorManager->AddDescriptor(new QmitkNodeDescriptor(QObject::tr("PlanarAngle"), QString(":/QmitkExt/PlanarAngle_48.png"), isPlanarAngle, descriptorManager)); // Adding "PlanarFourPointAngle" mitk::NodePredicateDataType::Pointer isPlanarFourPointAngle = mitk::NodePredicateDataType::New("PlanarFourPointAngle"); descriptorManager->AddDescriptor(new QmitkNodeDescriptor(QObject::tr("PlanarFourPointAngle"), QString(":/QmitkExt/PlanarFourPointAngle_48.png"), isPlanarFourPointAngle, descriptorManager)); // Adding "PlanarRectangle" mitk::NodePredicateDataType::Pointer isPlanarRectangle = mitk::NodePredicateDataType::New("PlanarRectangle"); descriptorManager->AddDescriptor(new QmitkNodeDescriptor(QObject::tr("PlanarRectangle"), QString(":/QmitkExt/PlanarRectangle_48.png"), isPlanarRectangle, descriptorManager)); // Adding "PlanarPolygon" mitk::NodePredicateDataType::Pointer isPlanarPolygon = mitk::NodePredicateDataType::New("PlanarPolygon"); descriptorManager->AddDescriptor(new QmitkNodeDescriptor(QObject::tr("PlanarPolygon"), QString(":/QmitkExt/PlanarPolygon_48.png"), isPlanarPolygon, descriptorManager)); // Adding "PlanarPath" mitk::NodePredicateProperty::Pointer isNotClosedPolygon = mitk::NodePredicateProperty::New("ClosedPlanarPolygon", mitk::BoolProperty::New(false)); mitk::NodePredicateAnd::Pointer isPlanarPath = mitk::NodePredicateAnd::New(isNotClosedPolygon, isPlanarPolygon); descriptorManager->AddDescriptor(new QmitkNodeDescriptor(QObject::tr("PlanarPath"), QString(":/QmitkExt/PlanarPath_48.png"), isPlanarPath, descriptorManager)); } + +void +mitk::PlanarFigureActivator::stop(ctkPluginContext* /*context*/) +{ +} + +Q_EXPORT_PLUGIN2(org_mitk_planarfigure, mitk::PlanarFigureActivator) diff --git a/Modules/Bundles/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.h b/Modules/Bundles/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.h index f6da0fff2f..6174f3d097 100644 --- a/Modules/Bundles/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.h +++ b/Modules/Bundles/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.h @@ -1,58 +1,53 @@ /*========================================================================= Program: MITK Platform Language: C++ Date: $Date: 2009-05-19 15:45:39 +0200 (Di, 19 Mai 2009) $ Version: $Revision: 17020 $ 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 MITKPLANARFIGUREACTIVATOR_H_ #define MITKPLANARFIGUREACTIVATOR_H_ -#include +#include -#include - -//#include -//#include namespace mitk { /** * \ingroup org_mitk_planarfigure_internal * * \brief The plug-in activator for the planar figure module * * When the plug-in is started by the framework, it initialzes planar figure specific things. */ -class ORG_MITK_PLANARFIGURE_EXPORT PlanarFigureActivator : - /*public QObject, */public berry::Plugin +class PlanarFigureActivator : + public QObject, public ctkPluginActivator { - //Q_OBJECT + Q_OBJECT + Q_INTERFACES(ctkPluginActivator) public: /** * Registers sandbox core object factories. */ - void Start(berry::IBundleContext::Pointer context); - - -private: + void start(ctkPluginContext* context); + void stop(ctkPluginContext* context); }; } #endif /* MITKPLANARFIGUREACTIVATOR_H_ */ diff --git a/Modules/Bundles/org.mitk.planarfigure/src/mitkPlanarFigureDll.h b/Modules/Bundles/org.mitk.planarfigure/src/mitkPlanarFigureDll.h deleted file mode 100644 index 720cdaae7a..0000000000 --- a/Modules/Bundles/org.mitk.planarfigure/src/mitkPlanarFigureDll.h +++ /dev/null @@ -1,43 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2009-05-28 20:03:37 +0200 (Do, 28 Mai 2009) $ -Version: $Revision: 17020 $ - -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 _MBI_PLANARFIGURE_EXPORT_DLL_H_ -#define _MBI_PLANARFIGURE_EXPORT_DLL_H_ - - -// -// The following block is the standard way of creating macros which make exporting -// from a DLL simpler. All files within this DLL are compiled with the org_mitk_planarfigure_EXPORTS -// symbol defined on the command line. this symbol should not be defined on any project -// that uses this DLL. This way any other project whose source files include this file see -// org_mitk_planarfigure_EXPORTS functions as being imported from a DLL, wheras this DLL sees symbols -// defined with this macro as being exported. -// -#if defined(_WIN32) && !defined(MITK_STATIC) - #if defined(org_mitk_planarfigure_EXPORTS) - #define ORG_MITK_PLANARFIGURE_EXPORT __declspec(dllexport) - #else - #define ORG_MITK_PLANARFIGURE_EXPORT __declspec(dllimport) - #endif -#endif - - -#if !defined(ORG_MITK_PLANARFIGURE_EXPORT) - #define ORG_MITK_PLANARFIGURE_EXPORT -#endif - -#endif /*_MBI_PLANARFIGURE_EXPORT_DLL_H_*/