Merge pull request #222 from thinking-tower/bugfix/python-installation-on-macos

Set PYTHON_INCLUDE_DIR and PYTHON_LIBRARY during installation
This commit is contained in:
Alejandro Saucedo 2021-05-27 18:12:09 +01:00 committed by GitHub
commit dccbe4abba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,8 @@
import os import os
import re import re
import sys
import platform import platform
import sys
import sysconfig
import subprocess import subprocess
from setuptools import setup, Extension from setuptools import setup, Extension
@ -43,7 +44,10 @@ class CMakeBuild(build_ext):
'-DKOMPUTE_OPT_BUILD_PYTHON=1', '-DKOMPUTE_OPT_BUILD_PYTHON=1',
'-DKOMPUTE_OPT_ENABLE_SPDLOG=0', '-DKOMPUTE_OPT_ENABLE_SPDLOG=0',
'-DKOMPUTE_OPT_REPO_SUBMODULE_BUILD=1', '-DKOMPUTE_OPT_REPO_SUBMODULE_BUILD=1',
'-DPYTHON_EXECUTABLE=' + sys.executable] '-DPYTHON_EXECUTABLE=' + sys.executable,
'-DPYTHON_INCLUDE_DIR=' + sysconfig.get_path('include'),
'-DPYTHON_LIBRARY=' + sysconfig.get_path('stdlib'),
]
cfg = 'Debug' if self.debug else 'Release' cfg = 'Debug' if self.debug else 'Release'
build_args = ['--config', cfg] build_args = ['--config', cfg]