From 05ed975f25e5b8a8e3f53cf398e013fa245bd7ae Mon Sep 17 00:00:00 2001 From: alfonso Date: Mon, 30 Sep 2024 09:17:10 +0200 Subject: [PATCH] Also look for Python with pybind11 --- cmake/YACMAPythonSetup.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmake/YACMAPythonSetup.cmake b/cmake/YACMAPythonSetup.cmake index 2f33d109..424496ad 100644 --- a/cmake/YACMAPythonSetup.cmake +++ b/cmake/YACMAPythonSetup.cmake @@ -15,6 +15,17 @@ endif() # Find Python interpreter. find_package(PythonInterp REQUIRED) +# Find Python through pybind11 +set(PYBIND11_FINDPYTHON ON) +find_package(pybind11 CONFIG REQUIRED) + +if (Python_INCLUDE_DIRS) + set( + YACMA_PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIRS}" + CACHE PATH "Path to the Python include dir." + ) +endif() + if(_YACMA_PYTHON_MODULE_NEED_LINK) # NOTE: this will give us both the Python lib and the Python include dir. find_package(PythonLibs REQUIRED)