From e8c6f5cb114fb9c0e056f325626da0a76b4a0e7e Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Fri, 11 Oct 2024 10:53:53 -0700 Subject: [PATCH] `PYBIND11_FINDPYTHON=ON` Reuse our `find_package(Python ...)` call and use new CMake logic in pybind11. https://pybind11.readthedocs.io/en/stable/compiling.html#modules-with-cmake Signed-off-by: Axel Huebl --- cmake/dependencies/pybind11.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/dependencies/pybind11.cmake b/cmake/dependencies/pybind11.cmake index 6719a38c37..70899de816 100644 --- a/cmake/dependencies/pybind11.cmake +++ b/cmake/dependencies/pybind11.cmake @@ -16,6 +16,11 @@ function(find_pybind11) message(STATUS "pybind11 repository: ${openPMD_pybind11_repo} (${openPMD_pybind11_branch})") endif() endif() + + # rely on our find_package(Python ...) call + # https://pybind11.readthedocs.io/en/stable/compiling.html#modules-with-cmake + set(PYBIND11_FINDPYTHON ON) + if(TARGET pybind11::module) # nothing to do, target already exists in the superbuild elseif(openPMD_USE_INTERNAL_PYBIND11 AND openPMD_pybind11_src)