-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.py
52 lines (45 loc) · 1.42 KB
/
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import os
from setuptools import find_packages, setup
from setuptools.extension import Extension
from Cython.Build import cythonize
# the current working directory
cwd = os.path.abspath(os.path.expanduser(
os.path.dirname(__file__)))
include = ['/opt/local/include',
os.path.expanduser('~/embree/include')]
library = ['/opt/local/lib',
os.path.expanduser('~/embree/lib')]
if os.name == 'nt':
include = [
'c:/Program Files/Intel/Embree3/include',
os.path.join(cwd, 'embree3', 'include')]
library = [
'c:/Program Files/Intel/Embree3/lib',
os.path.join(cwd, 'embree3', 'lib')]
extensions = [
Extension(
'embree',
['embree.pyx'],
libraries=['embree3'],
include_dirs=include,
library_dirs=library
)
]
with open(os.path.join(cwd, 'README.md'), 'r') as f:
long_description = f.read()
with open(os.path.join(cwd, 'embree.pyx'), 'r') as f:
# use eval to get a clean string of version from file
__version__ = eval(
next(line for line in f if
line.startswith('__version__')).split('=')[-1])
setup(
name='embree',
version=__version__,
description='Ray queries on triangular meshes.',
long_description=long_description,
long_description_content_type='text/markdown',
install_requires=['numpy'],
packages=find_packages(),
ext_modules=cythonize(extensions),
zip_safe=False
)