forked from etiennedub/pyk4a
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
25 lines (19 loc) · 765 Bytes
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from setuptools import setup, Extension
import sys
if sys.version_info[0] == 2:
sys.exit("Python 2 is not supported.")
# Enables --editable install with --user
# https://github.com/pypa/pip/issues/7953
import site
site.ENABLE_USER_SITE = "--user" in sys.argv[1:]
# Bypass import numpy before running install_requires
# https://stackoverflow.com/questions/54117786/add-numpy-get-include-argument-to-setuptools-without-preinstalled-numpy
class get_numpy_include:
def __str__(self):
import numpy
return numpy.get_include()
module = Extension('k4a_module',
sources=['pyk4a/pyk4a.cpp'],
include_dirs=[get_numpy_include()],
libraries=['k4a', 'k4arecord'])
setup(ext_modules=[module])