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) diff --git a/setup.py b/setup.py index 4ecbfc5c68..8f81f4b652 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,6 @@ def build_extension(self, ext): os.path.join(extdir, "openpmd_api"), # '-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=' + extdir, '-DopenPMD_PYTHON_OUTPUT_DIRECTORY=' + extdir, - '-DPython_EXECUTABLE=' + sys.executable, '-DopenPMD_USE_PYTHON:BOOL=ON', # variants '-DopenPMD_USE_MPI:BOOL=' + openPMD_USE_MPI,