forked from DOI-USGS/usgscsm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
54 lines (48 loc) · 2.2 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
import os
import pkg_resources
import sys
import sysconfig
from setuptools import setup, Extension, find_packages
from Cython.Build import cythonize
# Look for the csmapi headers in the standard location
incdir = os.path.dirname(sysconfig.get_path('include'))
INCLUDE_DIRS = ['include/json', 'include/genericframe', 'include/orex',
'include/genericls',
'include/', incdir, os.path.join(incdir, 'csm')]
LIBRARY_DIRS = [] # This assumes that libcsmapi is installed in a standard place
LIBRARIES = ['csmapi']
COMPILE_ARGS = ['-g', '-std=c++11']#, '-stdlib=libc++']
if sys.platform == 'darwin':
COMPILE_ARGS.append('-mmacosx-version-min=10.9')
elif sys.platform.startswith("win"):
try:
INCLUDE_DIRS.append(os.path.join(os.environ['LIBRARY_INC'], 'csm'))
except: pass
COMPILE_ARGS = []
def generate_extension(path_name, sources):
return Extension(path_name,
sources=sources,
extra_compile_args=COMPILE_ARGS,
language='c++',
include_dirs=INCLUDE_DIRS,
runtime_library_dirs=LIBRARY_DIRS,
libraries=LIBRARIES)
# Create the extensions
extensions = [generate_extension('usgscam.genericframe', ['usgscam/genericframe.pyx',
'src/UsgsAstroFramePlugin.cpp',
'src/UsgsAstroFrameSensorModel.cpp']),
generate_extension('usgscam.orex', ['usgscam/orex.pyx',
'src/ORexPlugin.cpp',
'src/ORexSensorModel.cpp']),
generate_extension('usgscam.genericls', ['usgscam/genericls.pyx',
'src/UsgsAstroLsPlugin.cpp',
'src/UsgsAstroLsSensorModel.cpp',
'src/UsgsAstroLsStateData.cpp'])]
setup(
name='usgscam',
version='0.1.0',
ext_modules=cythonize(extensions),
description='Cython wrapper to the USGS MDIS Camera Model',
author='Jay Laura',
packages = find_packages(),
install_requires=['cycsm'])