mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-23 22:58:37 -05: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:
@@ -34,7 +34,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
|
||||
@@ -46,7 +46,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)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user