Skip to content
Newer
Older
100644 87 lines (76 sloc) 3.06 KB
099ff4b continuing work on namespace package and split of C/Python packages
astraw authored Dec 28, 2007
1 from setuptools import setup, find_packages
3c7efa2 move Python interface of cam_iface to its own package
astraw authored Dec 27, 2007
2 from setuptools.dist import Distribution
3 import os, sys
4
5 import setupext, setup_autogen
6
315151c working (mostly, anyhow) with new package layout
astraw authored Dec 28, 2007
7 package_data={}
3c7efa2 move Python interface of cam_iface to its own package
astraw authored Dec 27, 2007
8 ext_modules = []
9
315151c working (mostly, anyhow) with new package layout
astraw authored Dec 28, 2007
10 build_ctypes_based_wrappers = True
8c92bba @astraw do not include shared libs (that's for libcamiface)
astraw authored May 10, 2009
11 include_shlibs_for_ctypes = False
315151c working (mostly, anyhow) with new package layout
astraw authored Dec 28, 2007
12
13 if sys.platform.startswith('linux'):
14 include_shlibs_for_ctypes = False
3c7efa2 move Python interface of cam_iface to its own package
astraw authored Dec 27, 2007
15
16 if sys.platform == 'win32':
17 build_pyrex_based_wrappers = False
18 else:
e75d41c use cam_iface unity backend for ctypes link-layer
astraw authored Jan 28, 2008
19 build_pyrex_based_wrappers = False
20 #build_pyrex_based_wrappers = True
3c7efa2 move Python interface of cam_iface to its own package
astraw authored Dec 27, 2007
21
f9e3aa3 @astraw use mega backend by default
astraw authored Nov 2, 2009
22 ctypes_backends = ['mega','unity']
315151c working (mostly, anyhow) with new package layout
astraw authored Dec 28, 2007
23 if build_ctypes_based_wrappers:
24 if include_shlibs_for_ctypes:
25 if sys.platform == 'win32':
26 prefix = 'cam_iface_'
27 extension = '.dll'
28 elif sys.platform.startswith('linux'):
29 prefix = 'libcam_iface_'
30 extension = '.so'
31 elif sys.platform.startswith('darwin'):
32 prefix = 'libcam_iface_'
33 extension = '.dylib'
34 else:
35 raise ValueError('unknown platform')
36 for backend in ctypes_backends:
37 fname = prefix+backend+extension
38 if not os.path.exists(os.path.join('cam_iface',fname)):
39 print '***** WARNING: Could not find file %s'%fname
40 package_data.setdefault('cam_iface',[]).append(fname)
3c7efa2 move Python interface of cam_iface to its own package
astraw authored Dec 27, 2007
41
efef80d make easy-to-build option when camiface not installed system-wide
astraw authored Mar 3, 2008
42 if 0:
43 opj = os.path.join
44 CAMIFACE_PREFIX='../cam_iface'
45 include_dirs = [opj(CAMIFACE_PREFIX,'inc'),
46 opj(CAMIFACE_PREFIX,'shmwrap')]
47 libpath = os.path.abspath(opj(CAMIFACE_PREFIX,'lib'))
48 print 'WARNING: compiling without system install of camiface. You probably need to do this:'
49 print 'export LD_LIBRARY_PATH=%s'%libpath
50 print 'export UNITY_BACKEND_DIR=%s'%libpath
51 else:
52 include_dirs = None
fd6d13e @astraw disable building shm extension, which is not part of libcamiface 0.5.2
astraw authored Apr 30, 2009
53 #ext_modules.append( setupext.get_shm_extension(include_dirs=include_dirs) )
3c7efa2 move Python interface of cam_iface to its own package
astraw authored Dec 27, 2007
54
55 pyrex_backends = []
56 if build_pyrex_based_wrappers:
57 #ext_modules.append( setupext.get_blank_extension() )
58 if sys.platform == 'win32':
59 #ext_modules.append( get_cmu1394_extension() )
60 #ext_modules.append( get_bcam_extension() )
61 pass # none compile easily out of the box
62 elif sys.platform.startswith('linux'):
63 #ext_modules.append( setupext.get_dc1394_extension() ); pyrex_backends.append('dc1394')
64 try:
315151c working (mostly, anyhow) with new package layout
astraw authored Dec 28, 2007
65 ext_modules.append( setupext.get_camwire_extension() )
66 pyrex_backends.append('camwire')
3c7efa2 move Python interface of cam_iface to its own package
astraw authored Dec 27, 2007
67 except Exception,err:
68 print 'WARNING: Not building camwire pyrex backend (error "%s")'%str(err)
099ff4b continuing work on namespace package and split of C/Python packages
astraw authored Dec 28, 2007
69
3c7efa2 move Python interface of cam_iface to its own package
astraw authored Dec 27, 2007
70 setup_autogen.generate_choose_module(pyrex_backends, ctypes_backends)
71
315151c working (mostly, anyhow) with new package layout
astraw authored Dec 28, 2007
72 setup(name='motmot.cam_iface',
73 description='cross-platform, cross-backend camera driver',
3c7efa2 move Python interface of cam_iface to its own package
astraw authored Dec 27, 2007
74 long_description="""cam_iface is the core packge of several that
75 are involved with digital camera acquisition and analysis""",
c6dc44d @astraw add url
astraw authored Apr 30, 2009
76 url='http://code.astraw.com/projects/motmot/cam_iface.html',
5c7ff55 @astraw bump version for release
astraw authored Nov 5, 2009
77 version='0.4.9',
3c7efa2 move Python interface of cam_iface to its own package
astraw authored Dec 27, 2007
78 author='Andrew Straw',
79 author_email='strawman@astraw.com',
80 license="BSD",
099ff4b continuing work on namespace package and split of C/Python packages
astraw authored Dec 28, 2007
81 namespace_packages = ['motmot'],
82 packages = find_packages(),#['cam_iface','cam_iface_choose'],
3c7efa2 move Python interface of cam_iface to its own package
astraw authored Dec 27, 2007
83 ext_modules=ext_modules,
84 zip_safe=True,
315151c working (mostly, anyhow) with new package layout
astraw authored Dec 28, 2007
85 package_data=package_data,
86 )
Something went wrong with that request. Please try again.