blob: ad9349b198e4b281aca847568271c1de2f97b234 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
pybind11 provides CMake integration:
# Easy
set(PYBIND11_FINDPYTHON ON)
find_package(pybind11 CONFIG REQUIRED)
pybind11_add_module(MyModule1 src1.cpp)
# Advanced
find_package(Python COMPONENTS Interpreter Development)
find_package(pybind11 CONFIG REQUIRED)
Python_add_library(MyModule2 src2.cpp)
target_link_libraries(MyModule2 PRIVATE pybind11::headers)
|