blob: f43c3a7b6d580281833ef806927e374b930e2c23 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
|
cmake_minimum_required(VERSION 3.5) # for Boost::* imported targets
project(example_python)
find_package(Python REQUIRED COMPONENTS Development)
set(boost_python "python${Python_VERSION_MAJOR}${Python_VERSION_MINOR}")
find_package(Boost REQUIRED COMPONENTS "${boost_python}")
add_library(hello SHARED hello.cpp)
target_link_libraries(hello PRIVATE Python::Module)
target_link_libraries(hello PRIVATE Boost::disable_autolinking "Boost::${boost_python}")
|