/[ascend]/trunk/models/SConscript
ViewVC logotype

Contents of /trunk/models/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1634 - (show annotations) (download)
Sat Oct 13 05:02:42 2007 UTC (12 years, 8 months ago) by jpye
File size: 1391 byte(s)
Limited set of model files installed by 'scons install'.
TODO: fix 'installer.nsi' to use the PACKAGE file lists also (need SubstInFile)
TODO: fix tarball to only include model files given in PACKAGE lists also (modified DistTar?)
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 if "PACKAGE" in files:
26 print "FOUND 'PACKAGE' file in %s..." % root
27 p = file(os.path.join(root,"PACKAGE"))
28 f1 = []
29 for l in p:
30 l1 = l.strip()
31 if not len(l1) or l1[0]=="#":
32 continue
33 f1.append(l1)
34 files = f1
35
36 for f in files:
37 if f in excludefiles:
38 continue
39 #print "ADDING",os.path.normpath(os.path.join(root,f))
40 modelfiles.append( os.path.normpath(os.path.join(root,f)) )
41 os.chdir(cwd)
42
43 #print "CWD =",cwd
44
45 modelsroot = '$INSTALL_ROOT$INSTALL_MODELS'
46
47 installeddirs = []
48
49 for f in modelfiles:
50 head,tail = os.path.split(f)
51 targetdir = Dir(env.subst(modelsroot)+"/"+head)
52
53 if not targetdir in installeddirs:
54 installeddirs.append(targetdir)
55 env.InstallShared(targetdir,f)
56
57 #print "MODEL INSTALLED DIRS =",installeddirs
58 Return('installeddirs')
59
60 # vim: set syntax=python:
61

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22