From 1fa7759213ebf07074bcdf0947117b1bc877881f Mon Sep 17 00:00:00 2001 From: Matthieu Simonin Date: Sat, 7 Nov 2020 22:23:25 +0100 Subject: [PATCH] python: force pybind11 discovery (#353) Fix #352 --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d5475b4c79..6a7975c194 100755 --- a/setup.py +++ b/setup.py @@ -47,6 +47,7 @@ class CMakeBuild(build_ext): self.build_extension(ext) def build_extension(self, ext): + from pybind11 import get_cmake_dir extdir = os.path.abspath(os.path.dirname( self.get_ext_fullpath(ext.name))) cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir, @@ -54,7 +55,9 @@ class CMakeBuild(build_ext): '-Denable_smpi=OFF', '-Denable_java=OFF', '-Denable_python=ON', - '-Dminimal-bindings=ON'] + '-Dminimal-bindings=ON', + '-Dpybind11_DIR=' + get_cmake_dir() + ] cfg = 'Debug' if self.debug else 'Release' build_args = ['--config', cfg] -- 2.20.1