| 1 |
Import('env') |
| 2 |
|
| 3 |
# Build directories that contain external libraries |
| 4 |
env.SConscript(['johnpye/SConscript'],['env']) |
| 5 |
env.SConscript(['test/SConscript'],['env']) |
| 6 |
env.SConscript(['sensitivity/SConscript'],['env']) |
| 7 |
|
| 8 |
# Hunt for all models in the directory structure |
| 9 |
import os, os.path |
| 10 |
|
| 11 |
modelfiles = [] |
| 12 |
|
| 13 |
excludedirs = ['.svn','CVS'] |
| 14 |
excludefiles = ['Makefile.in','SConscript','update-Makefile.pl'] |
| 15 |
|
| 16 |
modeldir = env.Dir(".").abspath |
| 17 |
#print "MODEL DIR =",modeldir |
| 18 |
|
| 19 |
cwd = os.getcwd() |
| 20 |
os.chdir(modeldir) |
| 21 |
for root,dirs,files in os.walk("."): |
| 22 |
for d in dirs: |
| 23 |
if d in excludedirs: |
| 24 |
dirs.remove(d) |
| 25 |
for f in files: |
| 26 |
if f in excludefiles: |
| 27 |
continue |
| 28 |
|
| 29 |
#print "ADDING",os.path.normpath(os.path.join(root,f)) |
| 30 |
modelfiles.append( os.path.normpath(os.path.join(root,f)) ) |
| 31 |
os.chdir(cwd) |
| 32 |
|
| 33 |
#print "CWD =",cwd |
| 34 |
|
| 35 |
modelsroot = '$INSTALL_ROOT$INSTALL_MODELS' |
| 36 |
|
| 37 |
installeddirs = [] |
| 38 |
|
| 39 |
for f in modelfiles: |
| 40 |
head,tail = os.path.split(f) |
| 41 |
targetdir = Dir(env.subst(modelsroot)+"/"+head) |
| 42 |
|
| 43 |
if not targetdir in installeddirs: |
| 44 |
installeddirs.append(targetdir) |
| 45 |
env.InstallShared(targetdir,f) |
| 46 |
|
| 47 |
#print "MODEL INSTALLED DIRS =",installeddirs |
| 48 |
Return('installeddirs') |
| 49 |
|
| 50 |
# vim: set syntax=python: |
| 51 |
|