-
Notifications
You must be signed in to change notification settings - Fork 31
/
setup.py
74 lines (68 loc) · 2.56 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
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# pyflycapture2 - python bindings for libflycapture2_c
# Copyright (C) 2012 Robert Jordens <robert@joerdens.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
try:
from setuptools import setup, Extension
except ImportError:
from distutils import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy
import os
if os.name == "posix":
libname = "flycapture-c"
else:
libname = "flycapture2_c"
if os.path.exists("C:/Program Files (x86)/Point Grey Research/FlyCapture2"):
pointgrey_win = "C:/Program Files (x86)/Point Grey Research/FlyCapture2"
else:
pointgrey_win = "C:/Program Files/Point Grey Research/FlyCapture2"
if os.path.exists(pointgrey_win+"/lib/C"):
libfolder = "/lib/C"
else:
libfolder = "/lib64/C"
setup(
name="pyflycapture2",
description="python wrapper for libflycapture2 (C-API)",
long_description=
"""The library itself is available from PointGrey:
http://www.ptgrey.com/support/downloads/download.asp (login required)
API docs:
http://www.ptgrey.com/support/downloads/documents/flycapture/Doxygen/C/html/index.html
(C API)
http://www.ptgrey.com/support/downloads/documents/flycapture/Doxygen/html/index.html
(C++ API)""",
version="0.1+dev",
author="Robert Jordens",
author_email="robert@joerdens.org",
url="http://launchpad.net/pyflycapture2",
license="GPLv3+",
install_requires=["numpy"],
#packages=["flycapture2"],
cmdclass = {'build_ext': build_ext},
#"test_flycapture2.py", "convert.py"
ext_modules = [Extension("flycapture2",
sources = ["src/flycapture2.pyx", "src/flycapture2_enums.pxi",
"src/_FlyCapture2Defs_C.pxd", "src/_FlyCapture2_C.pxd",],
libraries = [libname],
library_dirs = ["%s%s" % (pointgrey_win, libfolder)],
include_dirs = ["/usr/include/flycapture/C",
"%s/include/C" % pointgrey_win,
numpy.get_include(), ],
),]
)