mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 13:20:47 -06:00
FindPython*: Manage weak link for Python modules
Add new target Python::Module which take care of platform requirements for Python module development. Fixes: #18100
This commit is contained in:
@@ -33,7 +33,7 @@ set_target_properties (example1 PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2"
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2")
|
||||
target_link_libraries(example1 PRIVATE Python2::Python)
|
||||
target_link_libraries(example1 PRIVATE Python2::Module)
|
||||
|
||||
# re-use sample interface file for another plugin
|
||||
swig_add_library(example2
|
||||
@@ -44,7 +44,7 @@ set_target_properties (example2 PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3"
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python3")
|
||||
target_link_libraries(example2 PRIVATE Python3::Python)
|
||||
target_link_libraries(example2 PRIVATE Python3::Module)
|
||||
|
||||
|
||||
add_test (NAME ModuleVersion2.example1
|
||||
|
||||
Reference in New Issue
Block a user