project(Boost CXX) cmake_minimum_required(VERSION 3.0) FIND_PACKAGE(Python 3 REQUIRED COMPONENTS Interpreter Development) INCLUDE_DIRECTORIES( ${Python_INCLUDE_DIRS} ) FIND_PACKAGE(Boost COMPONENTS python${Python_VERSION_MAJOR}${Python_VERSION_MINOR} REQUIRED) INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS}) ADD_LIBRARY(demo1 SHARED demo1.cpp) TARGET_LINK_LIBRARIES(demo1 ${Boost_LIBRARIES} ${Python_LIBRARIES}) ADD_LIBRARY(demo2 SHARED demo2.cpp) TARGET_LINK_LIBRARIES(demo2 ${Boost_LIBRARIES} ${Python_LIBRARIES})