diff --git a/CMakeExternals/CTK.cmake b/CMakeExternals/CTK.cmake index afb4863bcf..89bd218417 100644 --- a/CMakeExternals/CTK.cmake +++ b/CMakeExternals/CTK.cmake @@ -1,64 +1,65 @@ #----------------------------------------------------------------------------- # CTK #----------------------------------------------------------------------------- IF(MITK_USE_CTK) # Sanity checks IF(DEFINED CTK_DIR AND NOT EXISTS ${CTK_DIR}) MESSAGE(FATAL_ERROR "CTK_DIR variable is defined but corresponds to non-existing directory") ENDIF() SET(proj CTK) SET(proj_DEPENDENCIES ) SET(CTK_DEPENDS ${proj}) IF(NOT DEFINED CTK_DIR) SET(revision_tag 34a638b) IF(${proj}_REVISION_TAG) SET(revision_tag ${${proj}_REVISION_TAG}) ENDIF() SET(ctk_optional_cache_args ) IF(MITK_USE_Python) LIST(APPEND ctk_optional_cache_args -DCTK_LIB_Scripting/Python/Widgets:BOOL=ON ) ENDIF() FOREACH(type RUNTIME ARCHIVE LIBRARY) IF(DEFINED CTK_PLUGIN_${type}_OUTPUT_DIRECTORY) LIST(APPEND mitk_optional_cache_args -DCTK_PLUGIN_${type}_OUTPUT_DIRECTORY:PATH=${CTK_PLUGIN_${type}_OUTPUT_DIRECTORY}) ENDIF() ENDFOREACH() ExternalProject_Add(${proj} GIT_REPOSITORY http://github.com/commontk/CTK.git GIT_TAG ${revision_tag} + SOURCE_DIR ${proj}-src BINARY_DIR ${proj}-build UPDATE_COMMAND "" INSTALL_COMMAND "" CMAKE_GENERATOR ${gen} CMAKE_ARGS ${ep_common_args} ${ctk_optional_cache_args} -DDESIRED_QT_VERSION:STRING=4 -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DGit_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE} -DGIT_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE} -DCTK_LIB_PluginFramework:BOOL=ON -DCTK_LIB_DICOM/Widgets:BOOL=ON -DCTK_PLUGIN_org.commontk.eventadmin:BOOL=ON -DCTK_PLUGIN_org.commontk.configadmin:BOOL=ON -DCTK_USE_GIT_PROTOCOL:BOOL=OFF DEPENDS ${proj_DEPENDENCIES} ) SET(CTK_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build) ELSE() mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") ENDIF() ENDIF() diff --git a/CMakeExternals/CableSwig.cmake b/CMakeExternals/CableSwig.cmake index e0c4eb5541..2e259a776a 100644 --- a/CMakeExternals/CableSwig.cmake +++ b/CMakeExternals/CableSwig.cmake @@ -1,41 +1,42 @@ #----------------------------------------------------------------------------- # CableSwig #----------------------------------------------------------------------------- IF(MITK_USE_Python) # Sanity checks IF(DEFINED CableSwig_DIR AND NOT EXISTS ${CableSwig_DIR}) MESSAGE(FATAL_ERROR "CableSwig_DIR variable is defined but corresponds to non-existing directory") ENDIF() SET(proj CableSwig) SET(proj_DEPENDENCIES ) SET(CableSwig_DEPENDS ${proj}) IF(NOT DEFINED CableSwig_DIR) SET(additional_cmake_args ) ExternalProject_Add(${proj} URL http://mitk.org/download/thirdparty/CableSwig-ITK-3.20.0.tar.gz + SOURCE_DIR ${proj}-src BINARY_DIR ${proj}-build INSTALL_COMMAND "" CMAKE_GENERATOR ${gen} CMAKE_ARGS ${ep_common_args} ${additional_cmake_args} -DBUILD_TESTING:BOOL=OFF -DSWIG_BUILD_EXAMPLES:BOOL=OFF DEPENDS ${proj_DEPENDENCIES} ) SET(CableSwig_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build) ELSE() mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") ENDIF() ENDIF() diff --git a/CMakeExternals/DCMTK.cmake b/CMakeExternals/DCMTK.cmake index d87833c8bf..d080624e89 100644 --- a/CMakeExternals/DCMTK.cmake +++ b/CMakeExternals/DCMTK.cmake @@ -1,52 +1,54 @@ #----------------------------------------------------------------------------- # DCMTK #----------------------------------------------------------------------------- IF(MITK_USE_DCMTK) # Sanity checks IF(DEFINED DCMTK_DIR AND NOT EXISTS ${DCMTK_DIR}) MESSAGE(FATAL_ERROR "DCMTK_DIR variable is defined but corresponds to non-existing directory") ENDIF() SET(proj DCMTK) SET(proj_DEPENDENCIES ) SET(DCMTK_DEPENDS ${proj}) IF(NOT DEFINED DCMTK_DIR) IF(UNIX) SET(DCMTK_CXX_FLAGS "-fPIC") SET(DCMTK_C_FLAGS "-fPIC") ENDIF(UNIX) IF(DCMTK_DICOM_ROOT_ID) SET(DCMTK_CXX_FLAGS "${DCMTK_CXX_FLAGS} -DSITE_UID_ROOT=\\\"${DCMTK_DICOM_ROOT_ID}\\\"") SET(DCMTK_C_FLAGS "${DCMTK_CXX_FLAGS} -DSITE_UID_ROOT=\\\"${DCMTK_DICOM_ROOT_ID}\\\"") ENDIF() ExternalProject_Add(${proj} URL http://mitk.org/download/thirdparty/dcmtk-3.6.0.tar.gz + SOURCE_DIR ${proj}-src + BINARY_DIR ${proj}-build INSTALL_DIR ${proj}-install PATCH_COMMAND ${CMAKE_COMMAND} -DTEMPLATE_FILE:FILEPATH=${MITK_SOURCE_DIR}/CMakeExternals/EmptyFileForPatching.dummy -P ${MITK_SOURCE_DIR}/CMakeExternals/PatchDCMTK-3.6.cmake CMAKE_GENERATOR ${gen} CMAKE_ARGS ${ep_common_args} -DDCMTK_OVERWRITE_WIN32_COMPILER_FLAGS:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF "-DCMAKE_CXX_FLAGS:STRING=${ep_common_CXX_FLAGS} ${DCMTK_CXX_FLAGS}" "-DCMAKE_C_FLAGS:STRING=${ep_common_C_FLAGS} ${DCMTK_C_FLAGS}" -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/${proj}-install -DDCMTK_WITH_ZLIB:BOOL=OFF # see bug #9894 -DDCMTK_WITH_OPENSSL:BOOL=OFF # see bug #9894 -DDCMTK_WITH_PNG:BOOL=OFF # see bug #9894 -DDCMTK_WITH_TIFF:BOOL=OFF # see bug #9894 -DDCMTK_WITH_XML:BOOL=OFF # see bug #9894 -DDCMTK_FORCE_FPIC_ON_UNIX:BOOL=ON DEPENDS ${proj_DEPENDENCIES} ) SET(DCMTK_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-install) ELSE() mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") ENDIF() ENDIF() diff --git a/CMakeExternals/GDCM.cmake b/CMakeExternals/GDCM.cmake index cd756c3a36..3a4c6cd209 100644 --- a/CMakeExternals/GDCM.cmake +++ b/CMakeExternals/GDCM.cmake @@ -1,55 +1,56 @@ #----------------------------------------------------------------------------- # GDCM #----------------------------------------------------------------------------- # Sanity checks IF(DEFINED GDCM_DIR AND NOT EXISTS ${GDCM_DIR}) MESSAGE(FATAL_ERROR "GDCM_DIR variable is defined but corresponds to non-existing directory") ENDIF() # Check if an external ITK build tree was specified. # If yes, use the GDCM from ITK, otherwise ITK will complain if(ITK_DIR) find_package(ITK) if(ITK_GDCM_DIR) set(GDCM_DIR ${ITK_GDCM_DIR}) endif() endif() SET(proj GDCM) SET(proj_DEPENDENCIES ) SET(GDCM_DEPENDS ${proj}) IF(NOT DEFINED GDCM_DIR) ExternalProject_Add(${proj} URL http://mitk.org/download/thirdparty/gdcm-2.0.18.tar.gz + SOURCE_DIR ${proj}-src BINARY_DIR ${proj}-build INSTALL_COMMAND "" PATCH_COMMAND ${CMAKE_COMMAND} -DTEMPLATE_FILE:FILEPATH=${MITK_SOURCE_DIR}/CMakeExternals/EmptyFileForPatching.dummy -P ${MITK_SOURCE_DIR}/CMakeExternals/PatchGDCM-2.0.18.cmake CMAKE_GENERATOR ${gen} CMAKE_ARGS ${ep_common_args} -DBUILD_SHARED_LIBS:BOOL=ON -DGDCM_BUILD_SHARED_LIBS:BOOL=ON -DBUILD_TESTING:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF DEPENDS ${proj_DEPENDENCIES} ) SET(GDCM_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build) SET(GDCM_IS_2_0_18 TRUE) ELSE() mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") FIND_PACKAGE(GDCM) IF( GDCM_BUILD_VERSION EQUAL "18") SET(GDCM_IS_2_0_18 TRUE) ELSE() SET(GDCM_IS_2_0_18 FALSE) ENDIF() ENDIF() diff --git a/CMakeExternals/ITK.cmake b/CMakeExternals/ITK.cmake index cb322f08ea..c5d96a1f00 100644 --- a/CMakeExternals/ITK.cmake +++ b/CMakeExternals/ITK.cmake @@ -1,63 +1,64 @@ #----------------------------------------------------------------------------- # ITK #----------------------------------------------------------------------------- # Sanity checks IF(DEFINED ITK_DIR AND NOT EXISTS ${ITK_DIR}) MESSAGE(FATAL_ERROR "ITK_DIR variable is defined but corresponds to non-existing directory") ENDIF() SET(proj ITK) SET(proj_DEPENDENCIES GDCM) IF(MITK_USE_Python) LIST(APPEND proj_DEPENDENCIES CableSwig) ENDIF() SET(ITK_DEPENDS ${proj}) IF(NOT DEFINED ITK_DIR) SET(additional_cmake_args ) IF(MINGW) SET(additional_cmake_args -DCMAKE_USE_WIN32_THREADS:BOOL=ON -DCMAKE_USE_PTHREADS:BOOL=OFF) ENDIF() IF(MITK_USE_Python) LIST(APPEND additional_cmake_args -DUSE_WRAP_ITK:BOOL=ON -DITK_USE_REVIEW:BOOL=ON -DCableSwig_DIR:PATH=${CableSwig_DIR} -DWRAP_ITK_JAVA:BOOL=OFF -DWRAP_ITK_TCL:BOOL=OFF ) ENDIF() IF(GDCM_IS_2_0_18) SET(ITK_PATCH_COMMAND ${CMAKE_COMMAND} -DTEMPLATE_FILE:FILEPATH=${MITK_SOURCE_DIR}/CMakeExternals/EmptyFileForPatching.dummy -P ${MITK_SOURCE_DIR}/CMakeExternals/PatchITK-3.20.cmake) ENDIF() ExternalProject_Add(${proj} URL http://mitk.org/download/thirdparty/InsightToolkit-3.20.1.tar.gz + SOURCE_DIR ${proj}-src BINARY_DIR ${proj}-build INSTALL_COMMAND "" PATCH_COMMAND ${ITK_PATCH_COMMAND} CMAKE_GENERATOR ${gen} CMAKE_ARGS ${ep_common_args} ${additional_cmake_args} -DBUILD_TESTING:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF -DITK_USE_SYSTEM_GDCM:BOOL=ON -DGDCM_DIR:PATH=${GDCM_DIR} DEPENDS ${proj_DEPENDENCIES} ) SET(ITK_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build) ELSE() mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") ENDIF() diff --git a/CMakeExternals/OpenCV.cmake b/CMakeExternals/OpenCV.cmake index 659aad76b3..350fbf194a 100644 --- a/CMakeExternals/OpenCV.cmake +++ b/CMakeExternals/OpenCV.cmake @@ -1,50 +1,51 @@ #----------------------------------------------------------------------------- # OpenCV #----------------------------------------------------------------------------- IF(MITK_USE_OpenCV) # Sanity checks IF(DEFINED OpenCV_DIR AND NOT EXISTS ${OpenCV_DIR}) MESSAGE(FATAL_ERROR "OpenCV_DIR variable is defined but corresponds to non-existing directory") ENDIF() SET(proj OpenCV) SET(proj_DEPENDENCIES) SET(OpenCV_DEPENDS ${proj}) IF(NOT DEFINED OpenCV_DIR) SET(additional_cmake_args ) IF(MITK_USE_Python) LIST(APPEND additional_cmake_args -DBUILD_NEW_PYTHON_SUPPORT:BOOL=ON ) ENDIF() SET(opencv_url http://mitk.org/download/thirdparty/OpenCV-2.3.0.tar.bz2) ExternalProject_Add(${proj} URL ${opencv_url} + SOURCE_DIR ${proj}-src BINARY_DIR ${proj}-build INSTALL_COMMAND "" CMAKE_GENERATOR ${gen} CMAKE_ARGS ${ep_common_args} -DBUILD_DOCS:BOOL=OFF -DBUILD_TESTS:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF -DBUILD_DOXYGEN_DOCS:BOOL=OFF ${additional_cmake_args} DEPENDS ${proj_DEPENDENCIES} ) SET(OpenCV_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build) ELSE() mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") ENDIF() ENDIF() diff --git a/CMakeExternals/VTK.cmake b/CMakeExternals/VTK.cmake index 6436463a7c..ca57c43543 100644 --- a/CMakeExternals/VTK.cmake +++ b/CMakeExternals/VTK.cmake @@ -1,82 +1,83 @@ #----------------------------------------------------------------------------- # VTK #----------------------------------------------------------------------------- IF(WIN32) OPTION(VTK_USE_SYSTEM_FREETYPE OFF) ELSE(WIN32) OPTION(VTK_USE_SYSTEM_FREETYPE ON) ENDIF(WIN32) # Sanity checks IF(DEFINED VTK_DIR AND NOT EXISTS ${VTK_DIR}) MESSAGE(FATAL_ERROR "VTK_DIR variable is defined but corresponds to non-existing directory") ENDIF() SET(proj VTK) SET(proj_DEPENDENCIES ) SET(VTK_DEPENDS ${proj}) IF(NOT DEFINED VTK_DIR) SET(additional_cmake_args ) IF(MINGW) SET(additional_cmake_args -DCMAKE_USE_WIN32_THREADS:BOOL=ON -DCMAKE_USE_PTHREADS:BOOL=OFF -DVTK_USE_VIDEO4WINDOWS:BOOL=OFF # no header files provided by MinGW ) ENDIF() IF(MITK_USE_Python) LIST(APPEND additional_cmake_args -DVTK_WRAP_PYTHON:BOOL=ON -DVTK_USE_TK:BOOL=OFF -DVTK_WINDOWS_PYTHON_DEBUGGABLE:BOOL=OFF ) ENDIF() IF(MITK_USE_QT) LIST(APPEND additional_cmake_args -DDESIRED_QT_VERSION:STRING=4 -DVTK_USE_GUISUPPORT:BOOL=ON -DVTK_USE_QVTK_QTOPENGL:BOOL=ON -DVTK_USE_QT:BOOL=ON -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} ) ENDIF() OPTION(MITK_USE_VTK_5_8_IN_SUPERBUILD OFF) IF(MITK_USE_VTK_5_8_IN_SUPERBUILD) SET(VTK_URL http://mitk.org/download/thirdparty/vtk-5.8.0.tar.gz) ELSE() SET(VTK_URL http://mitk.org/download/thirdparty/vtk-5.6.1.tar.gz) ENDIF() ExternalProject_Add(${proj} URL ${VTK_URL} + SOURCE_DIR ${proj}-src BINARY_DIR ${proj}-build INSTALL_COMMAND "" CMAKE_GENERATOR ${gen} CMAKE_ARGS ${ep_common_args} -DVTK_WRAP_TCL:BOOL=OFF -DVTK_WRAP_PYTHON:BOOL=OFF -DVTK_WRAP_JAVA:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=ON -DVTK_USE_PARALLEL:BOOL=ON -DVTK_USE_CHARTS:BOOL=OFF -DVTK_USE_QTCHARTS:BOOL=ON -DVTK_USE_GEOVIS:BOOL=OFF -DVTK_USE_SYSTEM_FREETYPE:BOOL=${VTK_USE_SYSTEM_FREETYPE} -DVTK_USE_QVTK_QTOPENGL:BOOL=OFF ${additional_cmake_args} DEPENDS ${proj_DEPENDENCIES} ) SET(VTK_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build) ELSE() mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") ENDIF()