mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 06:09:52 -06:00
Add new target Python::Module which take care of platform requirements for Python module development. Fixes: #18100
12 lines
331 B
CMake
12 lines
331 B
CMake
|
|
cmake_policy(SET CMP0078 NEW)
|
|
|
|
find_package(Python REQUIRED COMPONENTS Development)
|
|
find_package (SWIG REQUIRED)
|
|
include(UseSWIG)
|
|
|
|
set_property (SOURCE example.i PROPERTY SWIG_MODULE_NAME "new_example")
|
|
|
|
swig_add_library(example LANGUAGE python TYPE MODULE SOURCES example.i)
|
|
target_link_libraries(example PRIVATE Python::Module)
|