forked from toinsson/pydepthsense
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
61 lines (52 loc) · 1.93 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
53
54
55
56
57
58
59
60
61
import sys
from platform import system
from distutils.core import setup, Extension
import numpy
##
## compatibility checks
##
try: from exceptions import NotImplementedError
except ImportError: pass
if sys.version_info >= (3, 0): # due to C extension wrapping
raise NotImplementedError("Python 3.x is not supported.")
ostype = system()
if ostype != 'Linux' and ostype != 'Windows':
raise NotImplementedError("Only Windows and Linux supported.")
##
## Platform dependant configuration
##
is_64bits = sys.maxsize > 2**32
## Windows 32bits
if ostype == 'Windows' and is_64bits == False:
depthsensesdk_path = "C:\\Program Files (x86)\\SoftKinetic\\DepthSenseSDK\\"
additional_include = './inc'
compile_args = ['/EHsc']
## Windows 64bits
elif ostype == 'Windows' and is_64bits == True:
depthsensesdk_path = "C:\\Program Files\\SoftKinetic\\DepthSenseSDK\\"
additional_include = './inc'
compile_args = ['/EHsc']
## Linux
elif ostype == 'Linux':
depthsensesdk_path = "/opt/softkinetic/DepthSenseSDK/"
additional_include = './'
compile_args = []
modname = 'pydepthsense'
libnames = ['DepthSense']
sourcefiles = ['src/depthsense.cxx', 'src/initdepthsense.cxx']
module = Extension(modname,
include_dirs = [numpy.get_include(), depthsensesdk_path+'include', additional_include],
libraries = libnames,
library_dirs = ['./lib', depthsensesdk_path+'lib'],
extra_compile_args = compile_args,
sources = sourcefiles)
setup (name = 'pydepthsense',
version = '1.0',
description = 'Python wrapper for the Senz3d camera under Linux.',
author = 'Antoine Loriette',
url = 'https://github.com/toinsson/pysenz3d-linux',
long_description = '''This wrapper provides the main functionality of the DS325, aka the
Creative Senz3d camera. It is based on the Softkinetic demo code and was kicked started from
the Github project of ...
''',
ext_modules = [module])