diff --git a/CMakeExternals/OpenCV.cmake b/CMakeExternals/OpenCV.cmake index b77868b187..5f7bf48c53 100644 --- a/CMakeExternals/OpenCV.cmake +++ b/CMakeExternals/OpenCV.cmake @@ -1,38 +1,49 @@ #----------------------------------------------------------------------------- # 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) + + OPTION(OpenCV_BUILD_NEW_PYTHON_SUPPORT "Build OpenCV Python wrappers" OFF) + MARK_AS_ADVANCED(OpenCV_BUILD_NEW_PYTHON_SUPPORT) + + IF(WIN32) + SET(opencv_url http://mitk.org/download/thirdparty/OpenCV-2.2.0-win.tar.bz2) + ELSE() + SET(opencv_url http://mitk.org/download/thirdparty/OpenCV-2.2.0.tar.bz2) + ENDIF() + ExternalProject_Add(${proj} - URL http://mitk.org/download/thirdparty/OpenCV-2.2.0.tar.bz2 + URL ${opencv_url} BINARY_DIR ${proj}-build INSTALL_COMMAND "" CMAKE_GENERATOR ${gen} CMAKE_ARGS ${ep_common_args} -DBUILD_TESTS:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF -DBUILD_DOXYGEN_DOCS:BOOL=OFF + -DBUILD_NEW_PYTHON_SUPPORT:BOOL=${OpenCV_BUILD_NEW_PYTHON_SUPPORT} DEPENDS ${proj_DEPENDENCIES} ) SET(OpenCV_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build) ELSE() mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") ENDIF() ENDIF()