From d742f7d9e6a99c5fb6fc9c80793c44ef451f7d50 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 14 Dec 2011 03:52:31 +0000 Subject: [PATCH] SCons now installs the fortran .mod files in the include directory --- Cantera/fortran/SConscript | 20 ++++++++++++++++---- SConstruct | 3 ++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Cantera/fortran/SConscript b/Cantera/fortran/SConscript index 999ad5d25..628416584 100644 --- a/Cantera/fortran/SConscript +++ b/Cantera/fortran/SConscript @@ -4,12 +4,24 @@ Import('env', 'buildTargets', 'installTargets') localenv = env.Clone() +f90_src = mglob(localenv, 'src', 'f90', 'cpp') + +artifacts = localenv.Object(f90_src) +mods = [o for o in artifacts if o.path.endswith('.mod')] +objs = [o for o in artifacts if not o.path.endswith('.mod')] + lib = localenv.Library(target=pjoin('..','..','lib','fct'), - source=mglob(localenv, 'src', 'f90', 'cpp')) + source=objs) +buildTargets.extend(lib) inst = localenv.Install('$ct_libdir', lib) +installTargets.extend(inst) + +installTargets.extend(localenv.Install('$ct_incdir', mods)) # Copy the mod files to the include directory -for mod in mglob(localenv, 'src', 'mod'): - copy = localenv.Command('../../include/cantera/%s' % mod.name, mod, - Copy('$TARGET', '$SOURCE')) +for mod in mods: + copy = localenv.Command(target=pjoin('..','..','include','cantera', mod.name), + source=mod, + action=Copy('$TARGET', '$SOURCE')) localenv.AddPostAction(lib, copy) + buildTargets.extend(copy) diff --git a/SConstruct b/SConstruct index aa5731ee0..0619dd854 100644 --- a/SConstruct +++ b/SConstruct @@ -109,7 +109,8 @@ if env['matlab_toolbox'] != 'n': # Options that apply only if building the Fortran interface if env['f90_interface']: opts.AddVariables( - PathVariable('f90', 'Fortran compiler', 'gfortran'), + PathVariable('f90', 'Fortran compiler', + 'gfortran', PathVariable.PathAccept), ('f90flags', '', '-O3') )