forked from mapillary/OpenSfM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
48 lines (41 loc) · 1.23 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
#!/usr/bin/env python
from __future__ import print_function
from distutils.core import setup
import os
import errno
import subprocess
import sys
def mkdir_p(path):
'''Make a directory including parent directories.
'''
try:
os.makedirs(path)
except os.error as exc:
if exc.errno != errno.EEXIST or not os.path.isdir(path):
raise
print("Configuring...")
mkdir_p('cmake_build')
cmake_command = ['cmake', '../opensfm/src']
if sys.version_info >= (3, 0):
cmake_command.extend([
'-DBUILD_FOR_PYTHON3=ON',
'-DBOOST_PYTHON3_COMPONENT=python-py{}{}'.format(
sys.version_info.major,
sys.version_info.minor)])
subprocess.Popen(cmake_command, cwd='cmake_build').wait()
print("Compiling extension...")
subprocess.Popen(['make', '-j4'], cwd='cmake_build').wait()
print("Building package")
setup(
name='OpenSfM',
version='0.1',
description='A Structure from Motion library',
url='https://github.com/mapillary/OpenSfM',
author='Mapillary',
license='BSD',
packages=['opensfm', 'opensfm.commands', 'opensfm.large'],
scripts=['bin/opensfm_run_all', 'bin/opensfm'],
package_data={
'opensfm': ['csfm.so', 'data/sensor_data.json']
},
)