diff --git a/.gitignore b/.gitignore index 7e8a087e9..b4a14078e 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/six/projects/csm/external/csm-3.0.3_2018.11.21.zip b/six/projects/csm/external/csm-3.0.3_2018.11.21.zip new file mode 100644 index 000000000..3bf595b0c Binary files /dev/null and b/six/projects/csm/external/csm-3.0.3_2018.11.21.zip differ diff --git a/six/projects/csm/external/wscript b/six/projects/csm/external/wscript index 5e5441ccf..b34fd9339 100644 --- a/six/projects/csm/external/wscript +++ b/six/projects/csm/external/wscript @@ -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 @@ -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='.', @@ -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: diff --git a/six/projects/csm/wscript b/six/projects/csm/wscript index 078c520d0..07faaa087 100644 --- a/six/projects/csm/wscript +++ b/six/projects/csm/wscript @@ -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): @@ -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): @@ -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',