diff --git a/Wrapping/CMakeLists.txt b/Wrapping/CMakeLists.txt index a59883031b..fe199678ec 100644 --- a/Wrapping/CMakeLists.txt +++ b/Wrapping/CMakeLists.txt @@ -1,21 +1,20 @@ if(MITK_WRAP_PYTHON_ENABLED) - message("MITK Python wrapping was successfully enabled") 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() diff --git a/Wrapping/Python/CMakeLists.txt b/Wrapping/Python/CMakeLists.txt index 764ab7e6f8..14d22a0f93 100644 --- a/Wrapping/Python/CMakeLists.txt +++ b/Wrapping/Python/CMakeLists.txt @@ -1,94 +1,94 @@ 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 ) 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 ) 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") + #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") + #message("SKBuild missing") include(LegacyPackaging.cmake) endif()