diff --git a/CMakeExternals/ACVD.cmake b/CMakeExternals/ACVD.cmake index 54fc13cf3d..409417331f 100644 --- a/CMakeExternals/ACVD.cmake +++ b/CMakeExternals/ACVD.cmake @@ -1,42 +1,42 @@ #----------------------------------------------------------------------------- # ACVD #----------------------------------------------------------------------------- if(MITK_USE_ACVD) # Sanity checks if(DEFINED ACVD_DIR AND NOT EXISTS ${ACVD_DIR}) message(FATAL_ERROR "ACVD_DIR variable is defined but corresponds to non-existing directory") endif() set(proj ACVD) set(proj_DEPENDENCIES VTK) set(ACVD_DEPENDS ${proj}) set(additional_cmake_args -DUSE_MULTITHREADING:BOOL=ON -DVTK_DIR:PATH=${VTK_DIR} ) - set(ACVD_PATCH_COMMAND ${CMAKE_COMMAND} -DTEMPLATE_FILE:FILEPATH=${MITK_SOURCE_DIR}/CMakeExternals/EmptyFileForPatching.dummy -P ${MITK_SOURCE_DIR}/CMakeExternals/PatchACVD.cmake) + set(ACVD_PATCH_COMMAND ${CMAKE_COMMAND} -DDESIRED_QT_VERSION:STRING=${DESIRED_QT_VERSION} -DTEMPLATE_FILE:FILEPATH=${MITK_SOURCE_DIR}/CMakeExternals/EmptyFileForPatching.dummy -P ${MITK_SOURCE_DIR}/CMakeExternals/PatchACVD.cmake) if(NOT DEFINED ACVD_DIR) ExternalProject_Add(${proj} SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}-src BINARY_DIR ${proj}-build PREFIX ${proj}-cmake URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/ACVD-vtk6_2d8f5ea5.tar.gz URL_MD5 ecc97728a86798b35c20eef964b094c9 PATCH_COMMAND ${ACVD_PATCH_COMMAND} INSTALL_COMMAND "" CMAKE_GENERATOR ${gen} CMAKE_ARGS ${ep_common_args} ${additional_cmake_args} DEPENDS ${proj_DEPENDENCIES} ) set(ACVD_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build) else() mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") endif() endif() diff --git a/CMakeExternals/PatchACVD.cmake b/CMakeExternals/PatchACVD.cmake index d7caa9ace7..5adea64096 100644 --- a/CMakeExternals/PatchACVD.cmake +++ b/CMakeExternals/PatchACVD.cmake @@ -1,54 +1,62 @@ +if(DESIRED_QT_VERSION MATCHES "5") + set(path "CMakeLists.txt") + file(STRINGS ${path} contents NEWLINE_CONSUME) + string(REPLACE "find_package(VTK" "find_package(Qt5Widgets REQUIRED)\nfind_package(VTK" contents ${contents}) + set(CONTENTS ${contents}) + configure_file(${TEMPLATE_FILE} ${path} @ONLY) +endif() + # Create Config.cmake file to make ACVD findable through config mode of find_package() file(WRITE "ACVDConfig.cmake.in" "set(ACVD_INCLUDE_DIRS \"@VTKSURFACE_INCLUDE_DIR@;@VTKDISCRETEREMESHING_INCLUDE_DIR@;@VTKVOLUMEPROCESSING_INCLUDE_DIR@\") set(ACVD_LIBRARY_DIRS \"@PROJECT_BINARY_DIR@/bin\") set(ACVD_LIBRARIES vtkSurface vtkDiscreteRemeshing vtkVolumeProcessing) add_definitions(-DDOmultithread)") file(APPEND "CMakeLists.txt" "CONFIGURE_FILE(ACVDConfig.cmake.in ACVDConfig.cmake @ONLY)") # Add vtkVersionMacros.h header file set(path "Common/vtkCurvatureMeasure.cxx") file(STRINGS ${path} contents NEWLINE_CONSUME) string(REPLACE "vtkNeighbourhoodComputation.h\"" "vtkNeighbourhoodComputation.h\"\n#include " contents ${contents}) set(CONTENTS ${contents}) configure_file(${TEMPLATE_FILE} ${path} @ONLY) # Add missing VTK_EXPORT to class declaration set(path "VolumeProcessing/vtkImageDataCleanLabels.h") file(STRINGS ${path} contents NEWLINE_CONSUME) string(REPLACE "ss" "ss VTK_EXPORT" contents ${contents}) set(CONTENTS ${contents}) configure_file(${TEMPLATE_FILE} ${path} @ONLY) # Replace int by vtkIdType, which are types of different size (x64) set(path "DiscreteRemeshing/vtkVerticesProcessing.h") file(STRINGS ${path} contents NEWLINE_CONSUME) string(REPLACE "int N" "vtkIdType N" contents ${contents}) set(CONTENTS ${contents}) configure_file(${TEMPLATE_FILE} ${path} @ONLY) # Replace VTK 5 module names by VTK 6 module names # Link to POSIX thread library set(path "DiscreteRemeshing/CMakeLists.txt") file(STRINGS ${path} contents NEWLINE_CONSUME) string(REPLACE "vtkCommon" "vtkCommonCore" contents ${contents}) string(REPLACE "vtkFiltering" "vtkFiltersCore" contents ${contents}) string(REPLACE "vtkImaging" "vtkImagingCore" contents ${contents}) string(REPLACE "vtkIO" "vtkIOCore" contents ${contents}) string(REPLACE "vtkRendering" "vtkRenderingCore" contents ${contents}) string(REPLACE "vtkHybrid" "vtkFiltersHybrid vtkImagingHybrid" contents ${contents}) string(REPLACE "ENDFOREACH(loop_var)" "ENDFOREACH()\nendif()" contents ${contents}) string(REPLACE "FOREACH(loop_var" "option(ACVD_BUILD_EXAMPLES \"build examples\" OFF) if(ACVD_BUILD_EXAMPLES) FOREACH(loop_var" contents ${contents}) set(CONTENTS ${contents}) configure_file(${TEMPLATE_FILE} ${path} @ONLY) diff --git a/Modules/DicomUI/CMakeLists.txt b/Modules/DicomUI/CMakeLists.txt index fac3a66d09..e0fcbef18f 100644 --- a/Modules/DicomUI/CMakeLists.txt +++ b/Modules/DicomUI/CMakeLists.txt @@ -1,7 +1,7 @@ include_directories(${CTK_INCLUDE_DIRS}) MITK_CREATE_MODULE( DEPENDS MitkCore - PACKAGE_DEPENDS CTK|CTKDICOMWidgets Qt4|QtGui+QtSql + PACKAGE_DEPENDS CTK|CTKDICOMWidgets Qt4|QtGui+QtSql Qt5|OpenGL+Sql+Widgets+Xml EXPORT_DEFINE MITK_DICOMUI_EXPORT ) diff --git a/Modules/DiffusionImaging/DiffusionCore/CMakeLists.txt b/Modules/DiffusionImaging/DiffusionCore/CMakeLists.txt index c6bbc6b951..53c8d0b53e 100644 --- a/Modules/DiffusionImaging/DiffusionCore/CMakeLists.txt +++ b/Modules/DiffusionImaging/DiffusionCore/CMakeLists.txt @@ -1,15 +1,20 @@ # With apple gcc 4.2.1 the following waring leads to an build error if boost is enabled if(APPLE) mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=empty-body" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) endif() MITK_CREATE_MODULE( SUBPROJECTS MITK-DTI INCLUDE_DIRS Algorithms Algorithms/Reconstruction Algorithms/Registration Algorithms/Reconstruction/MultishellProcessing DicomImport IODataStructures/DiffusionWeightedImages IODataStructures/QBallImages IODataStructures/TensorImages IODataStructures Rendering ${CMAKE_CURRENT_BINARY_DIR} DEPENDS MitkMapperExt MitkPlanarFigure MitkImageExtraction MitkSceneSerializationBase MitkDICOMReader PACKAGE_DEPENDS VTK|vtkFiltersProgrammable ITK|ITKDistanceMap+ITKRegistrationCommon+ITKLabelVoting+ITKVTK Boost ITK|ITKMetricsv4+ITKRegistrationMethodsv4 WARNINGS_AS_ERRORS ) +if(MSVC) + list(APPEND module_compile_flags /wd4005) + set_target_properties(${MODULE_TARGET} PROPERTIES COMPILE_FLAGS "${module_compile_flags}") + endif() + add_subdirectory(Testing) diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/CMakeLists.txt b/Plugins/org.mitk.gui.qt.cmdlinemodules/CMakeLists.txt index 7983a10989..55809c14af 100644 --- a/Plugins/org.mitk.gui.qt.cmdlinemodules/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/CMakeLists.txt @@ -1,8 +1,8 @@ project(org_mitk_gui_qt_cmdlinemodules) MACRO_CREATE_MITK_CTK_PLUGIN( EXPORT_DIRECTIVE CLI_EXPORT EXPORTED_INCLUDE_SUFFIXES src MODULE_DEPENDS MitkQtWidgetsExt - PACKAGE_DEPENDS CTK Qt4|QtUiTools + PACKAGE_DEPENDS CTK|CTKCommandLineModulesFrontendQtGui+CTKCommandLineModulesBackendLocalProcess Qt4|QtUiTools Qt5|UiTools+XmlPatterns ) diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/CMakeLists.txt b/Plugins/org.mitk.gui.qt.diffusionimagingapp/CMakeLists.txt index d2a1d8b798..8884b6c47a 100644 --- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/CMakeLists.txt @@ -1,14 +1,14 @@ # The project name must correspond to the directory name of your plug-in # and must not contain periods. project(org_mitk_gui_qt_diffusionimagingapp) MACRO_CREATE_MITK_CTK_PLUGIN( EXPORT_DIRECTIVE DIFFUSIONIMAGING_APP_EXPORT EXPORTED_INCLUDE_SUFFIXES src MODULE_DEPENDS MitkQtWidgets MitkSceneSerialization - PACKAGE_DEPENDS Qt4|QtWebKit + PACKAGE_DEPENDS Qt4|QtWebKit Qt5|WebKitWidgets ) if(QT_QTWEBKIT_FOUND) add_definitions(-DQT_WEBKIT) endif(QT_QTWEBKIT_FOUND) diff --git a/Plugins/org.mitk.gui.qt.dtiatlasapp/CMakeLists.txt b/Plugins/org.mitk.gui.qt.dtiatlasapp/CMakeLists.txt index 1ae889096d..6a242b4c90 100644 --- a/Plugins/org.mitk.gui.qt.dtiatlasapp/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.dtiatlasapp/CMakeLists.txt @@ -1,14 +1,14 @@ # The project name must correspond to the directory name of your plug-in # and must not contain periods. project(org_mitk_gui_qt_dtiatlasapp) MACRO_CREATE_MITK_CTK_PLUGIN( EXPORT_DIRECTIVE DTIATLAS_APP_EXPORT EXPORTED_INCLUDE_SUFFIXES src MODULE_DEPENDS MitkQtWidgets MitkSceneSerialization - PACKAGE_DEPENDS Qt4|QtWebKit + PACKAGE_DEPENDS Qt4|QtWebKit Qt5|WebKitWidgets ) if(QT_QTWEBKIT_FOUND) add_definitions(-DQT_WEBKIT) endif(QT_QTWEBKIT_FOUND) diff --git a/Plugins/org.mitk.gui.qt.remeshing/CMakeLists.txt b/Plugins/org.mitk.gui.qt.remeshing/CMakeLists.txt index 34efdc8fe3..fdc8add159 100644 --- a/Plugins/org.mitk.gui.qt.remeshing/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.remeshing/CMakeLists.txt @@ -1,9 +1,10 @@ project(org_mitk_gui_qt_remeshing) include_directories(${CTK_INCLUDE_DIRS}) MACRO_CREATE_MITK_CTK_PLUGIN( EXPORT_DIRECTIVE REMESHING_EXPORT EXPORTED_INCLUDE_SUFFIXES src MODULE_DEPENDS MitkQtWidgets MitkRemeshing + PACKAGE_DEPENDS Qt4|QtCore Qt5|OpenGL+Xml )