Skip to content
Snippets Groups Projects
Commit 0d791d9e authored by Grégoire Kubler's avatar Grégoire Kubler
Browse files

fix : python::python not needed (told you so)

parent c84ff493
No related branches found
No related tags found
2 merge requests!212Version 0.3.0,!116feat/release_pip
Pipeline #45527 canceled
...@@ -4,7 +4,7 @@ macro(generate_python_binding ) ...@@ -4,7 +4,7 @@ macro(generate_python_binding )
# Use the New FindPython mode, recommanded. Requires CMake 3.15+ # Use the New FindPython mode, recommanded. Requires CMake 3.15+
find_package(Python 3.7.0 find_package(Python 3.7.0
COMPONENTS Interpreter Development.Module COMPONENTS Interpreter Development.Module
REQUIRED) REQUIRED)
set(PYBIND11_FINDPYTHON ON) set(PYBIND11_FINDPYTHON ON)
set(PYBIND_VERSION v2.10.4) set(PYBIND_VERSION v2.10.4)
...@@ -21,11 +21,10 @@ macro(generate_python_binding ) ...@@ -21,11 +21,10 @@ macro(generate_python_binding )
pybind11_add_module(${project} MODULE ${pybind_src_files} "NO_EXTRAS") # NO EXTRA required for pip install pybind11_add_module(${project} MODULE ${pybind_src_files} "NO_EXTRAS") # NO EXTRA required for pip install
target_include_directories(${project} PUBLIC "python_binding" ${pybind11_INCLUDE_DIRECTORIES}) target_include_directories(${project} PUBLIC "python_binding" ${pybind11_INCLUDE_DIRECTORIES})
# Handles Python + pybind11 headers dependencies # Handles Python + pybind11 headers dependencies
target_link_libraries(${module_name} target_link_libraries(${module_name}
PRIVATE PRIVATE
Python::Module Python::Module
PUBLIC PUBLIC
pybind11::pybind11 pybind11::pybind11
) )
......
...@@ -46,15 +46,7 @@ class CMakeBuild(build_ext): ...@@ -46,15 +46,7 @@ class CMakeBuild(build_ext):
# Impose to use the executable of the python # Impose to use the executable of the python
# used to launch setup.py to setup PythonInterp # used to launch setup.py to setup PythonInterp
python_executable = sys.executable python_executable = sys.executable
python_include_dirs = sysconfig.get_path('include') print(f"python executable :\t{python_executable}")
python_library = sysconfig.get_config_var('LIBDIR')
python_prefix = sys.exec_prefix
print(f"python\texecutable\t{python_executable}")
print(f"\t\t\tinclude\tdirs {python_include_dirs}")
print(f"-DPYTHON_INCLUDE_DIRS={sysconfig.get_config_var('INCLUDEPY')}") # this might need to be the subdir
print(f"\t\t\tlibrary\t{python_library}")
print(f"-DPYTHON_LIBRARIES={sysconfig.get_config_var('LIBDEST')}")
print(f"\t\t\tprefix\t{python_prefix}")
compile_type = "Debug" compile_type = "Debug"
install_path = ( install_path = (
os.path.join(sys.prefix, "lib", "libAidge") os.path.join(sys.prefix, "lib", "libAidge")
...@@ -66,8 +58,6 @@ class CMakeBuild(build_ext): ...@@ -66,8 +58,6 @@ class CMakeBuild(build_ext):
"cmake", "cmake",
str(cwd), str(cwd),
f"-DPYTHON_EXECUTABLE={sys.executable}", f"-DPYTHON_EXECUTABLE={sys.executable}",
f"-DPYTHON_INCLUDE_DIRS={sysconfig.get_config_var('INCLUDEPY')}",
f"-DPYTHON_LIBRARIES={sysconfig.get_config_var('LIBDEST')}",
"-DTEST=OFF", "-DTEST=OFF",
f"-DCMAKE_INSTALL_PREFIX:PATH={install_path}", f"-DCMAKE_INSTALL_PREFIX:PATH={install_path}",
f"-DCMAKE_BUILD_TYPE={compile_type}", f"-DCMAKE_BUILD_TYPE={compile_type}",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment