diff --git a/setup.py b/setup.py index e92cd901ae7a7296b01105060d6a3f7e0eb29a5e..1ed3b124aefe35f4c257f856587f8c9579bfb3d1 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import sys import os - +import sysconfig import shutil import pathlib import multiprocessing @@ -46,7 +46,13 @@ class CMakeBuild(build_ext): # Impose to use the executable of the python # used to launch setup.py to setup PythonInterp python_executable = sys.executable + python_include_dirs = sysconfig.get_path('include') + python_library = sysconfig.get_config_var('LIBDIR') + python_prefix = sys.exec_prefix print(f"python executable {python_executable}") + print(f"python include dirs {python_include_dirs}") + print(f"python library {python_library}") + print(f"python prefix {python_prefix}") compile_type = "Debug" install_path = ( @@ -54,12 +60,13 @@ class CMakeBuild(build_ext): if "AIDGE_INSTALL" not in os.environ else os.environ["AIDGE_INSTALL"] ) - self.spawn( [ "cmake", str(cwd), - "-DPYTHON_EXECUTABLE="+python_executable, + f"-DPYTHON_EXECUTABLE={python_executable}", + f"-DPYTHON_INCLUDE_DIR={python_include_dirs}", + f"-DPYTHON_LIBRARY={python_library}", "-DTEST=OFF", f"-DCMAKE_INSTALL_PREFIX:PATH={install_path}", f"-DCMAKE_BUILD_TYPE={compile_type}",