diff --git a/Wrapping/Python/CMakeLists.txt b/Wrapping/Python/CMakeLists.txt index 14d22a0f93..cc3a118c0f 100644 --- a/Wrapping/Python/CMakeLists.txt +++ b/Wrapping/Python/CMakeLists.txt @@ -1,94 +1,85 @@ include(mitkTargetLinkLibrariesWithDynamicLookup) project(MITK_Python) set(CMAKE_SHARED_LINKER_FLAGS "" CACHE INTERNAL "" FORCE) set(CMAKE_MODULE_LINKER_FLAGS "" CACHE INTERNAL "" FORCE) mitk_check_dynamic_lookup(MODULE SHARED MITK_UNDEFINED_SYMBOLS_ALLOWED ) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) option(MITK_PYTHON_THREADS "Enable threaded python usage by unlocking the GIL." ON ) option(MITK_PYTHON_EGG "Add building of python eggs to the dist target." OFF ) option(MITK_PYTHON_WHEEL "Add building of python wheels to the dist target." ON ) mark_as_advanced( MITK_PYTHON_THREADS MITK_PYTHON_EGG MITK_PYTHON_WHEEL ) +set(libraries + MitkCore + MitkCLCore + MitkCLUtilities + ITKCommon + MitkSegmentation + MitkMultilabel + MitkDICOM + MitkDICOMImageIO + MitkRT +) + if(MITK_USE_MatchPoint) - set(libraries - MitkCore - MitkCLCore - MitkCLUtilities - ITKCommon - MitkMatchPointRegistration - MitkSegmentation - MitkMultilabel - MitkDICOM - MitkDICOMImageIO - MitkRT - ) -else() - set(libraries - MitkCore - MitkCLCore - MitkCLUtilities - ITKCommon - MitkSegmentation - MitkMultilabel - MitkDICOM - MitkDICOMImageIO - MitkRT - ) + list(APPEND libraries + MitkMatchPointRegistration + ) endif() mitkSwigPrepareFiles(pyMITK MITK.i ${libraries}) set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_GLOBAL_FLAGS} -features autodoc=1 -keyword) if(MITK_PYTHON_THREADS) list(APPEND CMAKE_SWIG_FLAGS -threads) endif() set(CMAKE_SWIG_OUTDIR ${MITK_BINARY_DIR}/lib/Release) set(UseSWIG_TARGET_NAME_PREFERENCE STANDARD) swig_add_library(pyMITK LANGUAGE python SOURCES MITK.i) set_property(TARGET pyMITK PROPERTY FOLDER "${MITK_ROOT_FOLDER}/Wrapping") target_link_libraries(pyMITK ${libraries}) mitk_target_link_libraries_with_dynamic_lookup(${SWIG_MODULE_pyMITK_REAL_NAME} ${Python3_LIBRARIES}) if(DEFINED SKBUILD) #message("SKBuild exists") install( FILES ${CMAKE_CURRENT_BINARY_DIR}/pyMITK.py ${CMAKE_CURRENT_SOURCE_DIR}/Packaging/__init__.py #${MITK_DOC_FILES} DESTINATION pyMITK COMPONENT Runtime ) install( TARGETS ${SWIG_MODULE_pyMITK_REAL_NAME} RUNTIME DESTINATION pyMITK LIBRARY DESTINATION pyMITK COMPONENT Runtime ) else() #message("SKBuild missing") include(LegacyPackaging.cmake) endif()