Import('env') # Build directories that contain external libraries env.SConscript(['johnpye/SConscript'],['env']) env.SConscript(['test/SConscript'],['env']) env.SConscript(['sensitivity/SConscript'],['env']) # Hunt for all models in the directory structure import os, os.path modelfiles = [] excludedirs = ['.svn','CVS'] excludefiles = ['Makefile.in','SConscript','update-Makefile.pl'] modeldir = env.Dir(".").abspath #print "MODEL DIR =",modeldir cwd = os.getcwd() os.chdir(modeldir) for root,dirs,files in os.walk("."): for d in dirs: if d in excludedirs: dirs.remove(d) for f in files: if f in excludefiles: continue #print "ADDING",os.path.normpath(os.path.join(root,f)) modelfiles.append( os.path.normpath(os.path.join(root,f)) ) os.chdir(cwd) #print "CWD =",cwd modelsroot = '$INSTALL_ROOT$INSTALL_MODELS' installeddirs = [] for f in modelfiles: head,tail = os.path.split(f) targetdir = Dir(env.subst(modelsroot)+"/"+head) if not targetdir in installeddirs: installeddirs.append(targetdir) env.InstallShared(targetdir,f) #print "MODEL INSTALLED DIRS =",installeddirs Return('installeddirs') # vim: set syntax=python: