-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathsetup.py
42 lines (34 loc) · 1.32 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
from distutils.core import setup, Extension
from distutils.command.build_ext import build_ext
import os,subprocess
class CommonBuild(build_ext):
def build_common(self):
if not os.path.exists(self.build_temp):
os.makedirs(self.build_temp)
comm_path = os.path.abspath('common')
subprocess.check_call(['cmake','-DCMAKE_BUILD_TYPE=Release',comm_path],cwd=self.build_temp)
subprocess.check_call(['cmake', '--build', '.'], cwd=self.build_temp)
def run(self):
try:
out = subprocess.check_output(['cmake', '--version'])
except OSError:
raise RuntimeError("CMake must be installed to build the following extensions: " +
", ".join(e.name for e in self.extensions))
self.build_temp = 'build'
self.build_common()
super().run()
setup(name='pinpointPy',
version="0.0.1.2",
author="The pinpoint Authors",
author_email='[email protected]',
license='Apache License 2.0',
ext_modules=[
Extension('pinpointPy',
['src/PY/pinpoint_py.c'],
include_dirs = ['common/include'],
library_dirs = ['common/lib'],
libraries = ['pinpoint_common','jsoncpp', 'rt', 'stdc++']
)
],
cmdclass={'build_ext': CommonBuild}
)