forked from snape/RVO2
-
Notifications
You must be signed in to change notification settings - Fork 63
/
setup.py
51 lines (43 loc) · 1.59 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
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
from Cython.Build import cythonize
class BuildRvo2Ext(_build_ext):
"""Builds RVO2 before our module."""
def run(self):
# Build RVO2
import os
import os.path
import subprocess
build_dir = os.path.abspath('build/RVO2')
if not os.path.exists(build_dir):
os.makedirs(build_dir)
subprocess.check_call(['cmake', '../..', '-DCMAKE_CXX_FLAGS=-fPIC'],
cwd=build_dir)
subprocess.check_call(['cmake', '--build', '.'], cwd=build_dir)
_build_ext.run(self)
extensions = [
Extension('rvo2', ['src/*.pyx'],
include_dirs=['src'],
libraries=['RVO'],
library_dirs=['build/RVO2/src'],
extra_compile_args=['-fPIC']),
]
setup(
name="pyrvo2",
ext_modules=cythonize(extensions),
cmdclass={'build_ext': BuildRvo2Ext},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Information Technology',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Cython',
'Topic :: Games/Entertainment :: Simulation',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)