setup.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 from distutils.core import setup
3 from distutils.extension import Extension
4 import re
5 import numpy as np
6 
7 
9  """
10  Returns:
11  Version as a pair of ints (major, minor)
12 
13  Raises:
14  ImportError: Can't load cython or find version
15  """
16  import Cython.Compiler.Main
17  match = re.search('^([0-9]+)\.([0-9]+)',
18  Cython.Compiler.Main.Version.version)
19  try:
20  return map(int, match.groups())
21  except AttributeError:
22  raise ImportError
23 
24 # Only use Cython if it is available, else just use the pre-generated files
25 try:
26  cython_version = get_cython_version()
27  # Requires Cython version 0.13 and up
28  if cython_version[0] == 0 and cython_version[1] < 13:
29  raise ImportError
30  from Cython.Distutils import build_ext
31  source_ext = '.pyx'
32  cmdclass = {'build_ext': build_ext}
33 except ImportError:
34  source_ext = '.c'
35  cmdclass = {}
36 
37 
38 ext_modules = [Extension("freenect", ["freenect" + source_ext],
39  libraries=['usb-1.0', 'freenect', 'freenect_sync'],
40  runtime_library_dirs=['/usr/local/lib',
41  '/usr/local/lib64',
42  '/usr/lib/'],
43  extra_compile_args=['-fPIC', '-I', '../../include/',
44  '-I', '/usr/include/libusb-1.0/',
45  '-I', '/usr/local/include/libusb-1.0',
46  '-I', '/usr/local/include',
47  '-I', '../c_sync/',
48  '-I', np.get_include()])]
49 setup(name='freenect',
50  cmdclass=cmdclass,
51  ext_modules=ext_modules)
Definition: setup.py:1
def get_cython_version()
Definition: setup.py:8


libfreenect
Author(s): Hector Martin, Josh Blake, Kyle Machulis, OpenKinect community
autogenerated on Thu Jun 6 2019 19:25:38