Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CSM to version 3.0.3 #255

Merged
merged 3 commits into from
Nov 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ install/

# Drivers
six/projects/csm/external/csm-master/
six/projects/csm/external/csm-3.0.3/
six/projects/csm/external/vts_301_0/
Binary file not shown.
23 changes: 16 additions & 7 deletions six/projects/csm/external/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ def configure(conf):
if re.match(osxRegex,sys.platform) or (re.match(winRegex, sys.platform) and 'MSVC_VERSION' not in conf.env):
Logs.warn('Disabling CSM as it is not supported on this platform')
else:
# NOTE: This was downloaded from https://github.com/johnpdpkarp/csm on
# 2013.07.03. Updates that occurred after the VTS release we got
# from Leonard Tomko seem to still be considered CSM 3.0.1.
unzipper(os.path.join(conf.path.abspath(), 'csm-3.0.1_2013.07.03.zip'),
# NOTE: This was downloaded from
# https://github.com/sminster/csm/releases 2018.11.21.
if Options.options.csm_version == '3.0.3':
csmZipfile = 'csm-3.0.3_2018.11.21.zip'
else:
csmZipfile = 'csm-3.0.1_2013.07.03.zip'
unzipper(os.path.join(conf.path.abspath(), csmZipfile),
conf.path.abspath())

# NOTE: Originally checked in the VTS zip file that was received from
Expand All @@ -34,11 +37,17 @@ def configure(conf):
unzipper(os.path.join(conf.path.abspath(), 'vts_301_0.zip'),
conf.path.abspath())
conf.env['HAVE_CSM'] = True
conf.env['INCLUDES_CSM'] = os.path.join(conf.path.abspath(), 'csm-master')

if Options.options.csm_version == '3.0.3':
conf.env['INCLUDES_CSM'] = os.path.join(conf.path.abspath(), 'csm-3.0.3')
conf.env['CSM_DIR'] = 'csm-3.0.3'
else:
conf.env['INCLUDES_CSM'] = os.path.join(conf.path.abspath(), 'csm-master')
conf.env['CSM_DIR'] = 'csm-master'

def build(bld):
if 'HAVE_CSM' in bld.env:
csmDir = 'csm-master'
csmDir = bld.env['CSM_DIR']
bld(features = 'cxx cshlib',
target='CSMAPI', name='CSMAPI',
includes='.',
Expand All @@ -61,7 +70,7 @@ def build(bld):

def distclean(context):
# remove the unzipped directory
dirs = filter(lambda x: os.path.exists(os.path.join(context.path.abspath(), x)),
dirs = filter(lambda x: os.path.exists(os.path.join(context.path.abspath(), x)),
['csm-master', 'vts_301_0'])
for d in dirs:
try:
Expand Down
18 changes: 12 additions & 6 deletions six/projects/csm/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ from waflib import Errors, Options
DIRS = 'external'

def options(opt):
opt.add_option('--csm-version', dest='csm_version',
choices=['3.0.3', '3.0.1'], default='3.0.3',
help='Choose verision of CSM to install')
opt.recurse(DIRS)

def configure(conf):
Expand Down Expand Up @@ -44,7 +47,10 @@ def configure(conf):
raise Errors.WafError('Unsupported platform %s' % sys.platform)

pluginVersion = '114'
csmVersion = '301'
if Options.options.csm_version == '3.0.3':
csmVersion = '303'
else:
csmVersion = '301'
conf.env['SIX_CSM_PLATFORM_NAME'] = 'SIX_SAR_RADIANT-SOLUTIONS_' + pluginVersion + '_' + platformName + '_CSM' + csmVersion

def build(bld):
Expand All @@ -63,21 +69,21 @@ def build(bld):
else:
modArgs['INCLUDES'] = ['include', bld.env['INCLUDES_CSM']]
bld.plugin(**modArgs)

bld.program_helper(module_deps='six.sicd',
source='tests/test_sicd_csm.cpp',
use='CSMAPI',
name='test_sicd_csm')

bld.program_helper(module_deps='scene six.sidd',
source='tests/test_sidd_csm.cpp',
use='CSMAPI',
name='test_sidd_csm')


# TODO: It seems like instead of this, I should be able to set
# modArgs['TARGETNAME'] to 'six-csm' and have that just be the
# name of the target. This works fine when building, but
# name of the target. This works fine when building, but
# something about how 'waf list' and 'waf msvs' operate makes this
# not work right.
bld(features='add_targets', target='six-csm',
Expand Down