diff --git a/CMakeExternals/ITK.cmake b/CMakeExternals/ITK.cmake index 2dde71437d..257933614f 100644 --- a/CMakeExternals/ITK.cmake +++ b/CMakeExternals/ITK.cmake @@ -1,98 +1,99 @@ #----------------------------------------------------------------------------- # 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() if(MITK_USE_OpenCV) list(APPEND proj_DEPENDENCIES OpenCV) 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 -DITK_WRAPPING:BOOL=ON + -ITK_WRAP_PYTHON=ON -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE} -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR} -DPYTHON_INCLUDE_DIR2:PATH=${PYTHON_INCLUDE_DIR2} -DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY} #-DPYTHON_LIBRARIES=${PYTHON_LIBRARY} #-DPYTHON_DEBUG_LIBRARIES=${PYTHON_DEBUG_LIBRARIES} -DCableSwig_DIR:PATH=${CableSwig_DIR} #-DITK_WRAP_JAVA:BOOL=OFF -DITK_WRAP_unsigned_char:BOOL=ON #-DITK_WRAP_double:BOOL=ON -DITK_WRAP_rgb_unsigned_char:BOOL=ON #-DITK_WRAP_rgba_unsigned_char:BOOL=ON -DITK_WRAP_signed_char:BOOL=ON #-DWRAP_signed_long:BOOL=ON -DITK_WRAP_signed_short:BOOL=ON -DITK_WRAP_short:BOOL=ON -DITK_WRAP_unsigned_long:BOOL=ON ) else() list(APPEND additional_cmake_args -DUSE_WRAP_ITK:BOOL=OFF ) endif() if(MITK_USE_OpenCV) list(APPEND additional_cmake_args -DModule_ITKVideoBridgeOpenCV:BOOL=ON -DOpenCV_DIR:PATH=${OpenCV_DIR} ) endif() # Keep the behaviour of ITK 4.3 which by default turned on ITK Review # see MITK bug #17338 list(APPEND additional_cmake_args -DModule_ITKReview:BOOL=ON ) set(ITK_PATCH_COMMAND ${CMAKE_COMMAND} -DTEMPLATE_FILE:FILEPATH=${MITK_SOURCE_DIR}/CMakeExternals/EmptyFileForPatching.dummy -P ${MITK_SOURCE_DIR}/CMakeExternals/PatchITK-4.5.1.cmake) ExternalProject_Add(${proj} SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}-src BINARY_DIR ${proj}-build PREFIX ${proj}-cmake URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/InsightToolkit-4.5.1-3e550bf8.tar.gz URL_MD5 80e433ffc0e81cdc19a03dd02a3c329b 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/Modules/Python/CMakeLists.txt b/Modules/Python/CMakeLists.txt index 475bb4d8bf..7881e47c26 100644 --- a/Modules/Python/CMakeLists.txt +++ b/Modules/Python/CMakeLists.txt @@ -1,12 +1,12 @@ if( MITK_USE_Python ) MITK_CREATE_MODULE( DEPENDS MitkCore EXPORT_DEFINE MITK_PYTHON_EXPORT - PACKAGE_DEPENDS Qt4|QtGui CTK PythonLibs + PACKAGE_DEPENDS Qt4|QtGui CTK PythonLibs VTK|vtkPython+vtkWrappingPythonCore ) configure_file(PythonPath.h.in "${CMAKE_CURRENT_BINARY_DIR}/PythonPath.h" @ONLY) add_subdirectory(Testing) endif() diff --git a/Modules/Python/PythonPath.h.in b/Modules/Python/PythonPath.h.in index 6f5daf2961..dded9c0ec3 100644 --- a/Modules/Python/PythonPath.h.in +++ b/Modules/Python/PythonPath.h.in @@ -1,21 +1,22 @@ #ifdef _DEBUG #define PYTHON_PATH_BUILD_TYPE "/Debug" #else #define PYTHON_PATH_BUILD_TYPE "/Release" #endif #define PYTHONPATH_COMMAND "import sys\n"\ "sys.path.append('@ITK_LIBRARY_DIRS@')\n"\ "sys.path.append('@ITK_DIR@/Wrapping/WrapITK/Python')\n"\ "sys.path.append('@ITK_LIBRARY_DIRS@" PYTHON_PATH_BUILD_TYPE "')\n"\ "sys.path.append('@ITK_DIR@/Wrapping/WrapITK/Python" PYTHON_PATH_BUILD_TYPE "')\n"\ "sys.path.append('@ITK_DIR@/Wrapping/Generators/Python')\n"\ "sys.path.append('@ITK_DIR@/lib')\n"\ "sys.path.append('@VTK_LIBRARY_DIRS@')\n"\ "sys.path.append('@VTK_DIR@/Wrapping/Python')\n"\ +"sys.path.append('@VTK_DIR@/Wrapping/PythonCore')\n"\ +"sys.path.append('@VTK_DIR@/lib')\n"\ "sys.path.append('@VTK_DIR@/bin" PYTHON_PATH_BUILD_TYPE "')\n"\ -"sys.path.append('@VTK_DIR@/Wrapping/Python')\n"\ "sys.path.append('@OpenCV_DIR@/lib" PYTHON_PATH_BUILD_TYPE "')\n"\ "sys.path.append('@OpenCV_DIR@/lib')\n"\ "sys.path.append('@OpenCV_DIR@/bin')\n"\ "sys.path.append('@OpenCV_DIR@/bin" PYTHON_PATH_BUILD_TYPE "')"