forked from kbrafford/pyfly2
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
61 lines (50 loc) · 1.76 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
#!/usr/bin/env python
# Build the pyd with
# python setup.py build_ext --inplace
#
# from setuptools import setup, Extension
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
import os.path
desc = """This is Keith Brafford's first attempt at
a wrapper for the FlyCapture2 C API.
"""
fc2_lib = ''
if os.name=='posix':
fc2_inc='/usr/include/flycapture'
fc2_shared='flycapture-c'
fc2_lib='/usr/lib'
data_files=[]
else:
# Windows
if os.path.exists('C:/Program Files (x86)/Point Grey Research/FlyCapture2'):
fc2_sdk = 'C:/Program Files (x86)/Point Grey Research/FlyCapture2'
else:
fc2_sdk = 'C:/Program Files/Point Grey Research/FlyCapture2'
if os.path.exists(os.path.join(fc2_sdk, 'lib/vs2015')):
fc2_lib = os.path.join(fc2_sdk, 'lib/vs2015')
elif os.path.exists(os.path.join(fc2_sdk, 'lib64/vs2015')):
fc2_lib = os.path.join(fc2_sdk, 'lib64/vs2015')
fc2_shared = 'FlyCapture2_Cd_v140'
# fc2_shared = 'FlyCapture2_C_v140'
data_files=['FlyCapture2_C_v140.dll', 'FlyCapture2_v140.dll', 'libiomp5md.dll']
# data_files=['FlyCapture2_C_v90.dll', 'FlyCapture2_v90.dll', 'libiomp5md.dll']
fc2_inc = [os.path.join(fc2_sdk, 'include')]
ext = [Extension('pyfly2', ['pyfly2.pyx'],
include_dirs= fc2_inc,
libraries=['FlyCapture2_C_v140'],
library_dirs=[fc2_lib],
extra_compile_args=['/Zi'],
extra_link_args=['/debug'],
)
]
setup(name='pyfly2',
version='0.2',
author='Keith Braddord',
license='BSD',
description=desc,
ext_modules=cythonize(ext),
requires=['Cython', 'numpy'],
data_files=data_files
)