112391Sjason@lowepower.comcmake_minimum_required(VERSION 3.0) 212391Sjason@lowepower.comproject(test_installed_embed CXX) 312391Sjason@lowepower.com 412391Sjason@lowepower.comset(CMAKE_MODULE_PATH "") 512391Sjason@lowepower.comfind_package(pybind11 CONFIG REQUIRED) 612391Sjason@lowepower.commessage(STATUS "Found pybind11 v${pybind11_VERSION}: ${pybind11_INCLUDE_DIRS}") 712391Sjason@lowepower.com 812391Sjason@lowepower.comadd_executable(test_cmake_build ../embed.cpp) 912391Sjason@lowepower.comtarget_link_libraries(test_cmake_build PRIVATE pybind11::embed) 1012391Sjason@lowepower.com 1112391Sjason@lowepower.com# Do not treat includes from IMPORTED target as SYSTEM (Python headers in pybind11::embed). 1212391Sjason@lowepower.com# This may be needed to resolve header conflicts, e.g. between Python release and debug headers. 1312391Sjason@lowepower.comset_target_properties(test_cmake_build PROPERTIES NO_SYSTEM_FROM_IMPORTED ON) 1412391Sjason@lowepower.com 1512391Sjason@lowepower.comadd_custom_target(check $<TARGET_FILE:test_cmake_build> ${PROJECT_SOURCE_DIR}/../test.py) 16