diff --git a/Modules/Python/CMakeLists.txt b/Modules/Python/CMakeLists.txt index 24b0fec937..7eafde2765 100644 --- a/Modules/Python/CMakeLists.txt +++ b/Modules/Python/CMakeLists.txt @@ -1,18 +1,8 @@ -if(MITK_USE_Python3) - set(OpenCV_DEP ) - if(MITK_USE_OpenCV) - set(OpenCV_DEP OpenCV) - endif() +mitk_create_module( + DEPENDS MitkCore + PACKAGE_DEPENDS PUBLIC Python3|Python +) - mitk_create_module( - DEPENDS MitkCore - PACKAGE_DEPENDS PUBLIC Python3|Python - ) - - if(BUILD_TESTING) - add_subdirectory(test) - endif() +if(TARGET ${MODULE_TARGET} AND BUILD_TESTING) + add_subdirectory(test) endif() - - - diff --git a/Modules/Python/test/files.cmake b/Modules/Python/test/files.cmake index 853d512ad2..609c1cd374 100644 --- a/Modules/Python/test/files.cmake +++ b/Modules/Python/test/files.cmake @@ -1,10 +1,11 @@ set(MODULE_TESTS - mitkPythonTest.cpp + mitkPythonTest.cpp ) -SET(CPP_FILES +set(CPP_FILES mitkPythonObserverMock.cpp ) -SET(H_FILES + +set(H_FILES mitkPythonObserverMock.h -) \ No newline at end of file +) diff --git a/Wrapping/CMakeLists.txt b/Wrapping/CMakeLists.txt index e4d7b634d4..f486270dfb 100644 --- a/Wrapping/CMakeLists.txt +++ b/Wrapping/CMakeLists.txt @@ -1,28 +1,30 @@ -if(MITK_USE_SWIG AND MITK_USE_Python3 AND Python3_FOUND) +if(MITK_USE_SWIG AND MITK_USE_MatchPoint AND MITK_USE_Python3) find_package(SWIG 4.0.2 COMPONENTS python) if(SWIG_FOUND) option(MITK_WRAP_PYTHON "" ON) if(MITK_WRAP_PYTHON) include(UseSWIG) include(mitkSwigPrepareFiles) # Path to common files set(MITK_WRAPPING_COMMON_DIR "${MITK_SOURCE_DIR}/Wrapping/Common") # Make a manual list of dependencies for the Swig.i files list(APPEND SWIG_EXTRA_DEPS "${MITK_WRAPPING_COMMON_DIR}/MITK_Common.i" ) # A general packaging target, not built by default, to build packages for each # language. This should depend on all language specific targets. add_custom_target(dist ${CMAKE_COMMAND} -E echo "Finished generating wrapped packages for distribution...") set_property(TARGET dist PROPERTY FOLDER "${MITK_ROOT_FOLDER}/Wrapping") add_subdirectory(Python) endif() + else() + message(SEND_ERROR "SWIG not found!") endif() endif()