SCons install target now copies header files to the installation directory

This commit is contained in:
Ray Speth 2011-12-14 03:52:26 +00:00
parent 702ae7251d
commit 2d8b1f4431
3 changed files with 28 additions and 14 deletions

View file

@ -18,8 +18,12 @@ libs = [('base', 'ctbase', ['cpp']),
for subdir, libname, extensions in libs:
for header in mglob(localenv, subdir, 'h'):
env.Command('../include/cantera/kernel/%s' % header.name, header,
Copy('$TARGET', '$SOURCE'))
h = localenv.Command('../include/cantera/kernel/%s' % header.name, header,
Copy('$TARGET', '$SOURCE'))
buildTargets.extend(h)
inst = localenv.Install(pjoin('$ct_incdir', 'kernel'), h)
installTargets.extend(inst)
lib = localenv.Library(pjoin('../lib', libname),
source=mglob(localenv, subdir, *extensions))
inst = localenv.Install('$ct_libdir', lib)

View file

@ -242,21 +242,12 @@ env['ct_mandir'] = pjoin(env['prefix'])
# *** Build Cantera ***
# *********************
# Put headers in place
for header in mglob(env, 'Cantera/cxx/include', 'h'):
env.Command('build/include/cantera/%s' % header.name, header,
Copy('$TARGET', '$SOURCE'))
for header in mglob(env, 'Cantera/clib/src', 'h'):
env.Command('build/include/cantera/clib/%s' % header.name, header,
Copy('$TARGET', '$SOURCE'))
env.Command('build/include/cantera/config.h', 'config.h', Copy('$TARGET', '$SOURCE'))
buildDir = 'build'
buildTargets = []
installTargets = []
env.SConsignFile()
env.Append(CPPPATH=[Dir(os.getcwd()),
Dir('build/include/cantera/kernel'),
Dir('build/include/cantera'),
@ -266,6 +257,26 @@ env.Append(CPPPATH=[Dir(os.getcwd()),
FORTRANFLAGS=['-fPIC'],
F90FLAGS=['-fPIC'])
# Put headers in place
for header in mglob(env, 'Cantera/cxx/include', 'h'):
header = env.Command('build/include/cantera/%s' % header.name, header,
Copy('$TARGET', '$SOURCE'))
buildTargets.extend(header)
inst = env.Install('$ct_incdir', header)
installTargets.extend(inst)
for header in mglob(env, 'Cantera/clib/src', 'h'):
hcopy = env.Command('build/include/cantera/clib/%s' % header.name, header,
Copy('$TARGET', '$SOURCE'))
buildTargets.append(header)
inst = env.Install(pjoin('$ct_incdir','clib'), header)
installTargets.extend(inst)
configh = env.Command('build/include/cantera/config.h', 'config.h', Copy('$TARGET', '$SOURCE'))
inst = env.Install('$ct_incdir', configh)
installTargets.extend(inst)
# Add targets from the SConscript files in the various subdirectories
Export('env', 'buildDir', 'buildTargets', 'installTargets')
VariantDir('build/ext', 'ext', duplicate=0)

View file

@ -6,7 +6,6 @@ localenv = env.Clone()
# (subdir, library name, (file extensions))
libs = [('tpx','tpx',['cpp'])]
print os.getcwd()
if env['build_with_f2c']:
libs.append(('f2c_math', 'ctmath', ['cpp','c']))