/[escript]/trunk/escript/test/DataArrayView/SConscript
ViewVC logotype

Annotation of /trunk/escript/test/DataArrayView/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 309 - (hide annotations)
Mon Dec 5 01:59:58 2005 UTC (13 years, 10 months ago) by jgs
File size: 2866 byte(s)
now load default options - by default!

1 jgs 235 # Scons configuration file for DataArrayView unit tests
2 jgs 196
3     import os
4 jgs 235 import sys
5 jgs 196
6 jgs 235 #
7     # ensure correct versions of python and scons
8 jgs 196
9 jgs 235 EnsurePythonVersion(2,3)
10     EnsureSConsVersion(0,96)
11 jgs 196
12 jgs 235 #
13     # set appropriate defaults for configuration variables
14 jgs 196
15 jgs 235 esysroot = Dir('#../../..')
16     usegcc = 0
17 jgs 246 options = None
18 jgs 252 sys_libs = []
19 jgs 196
20 jgs 235 #
21 jgs 248 # import configuration variables passed in from
22     # calling SConscript (if any)
23    
24     Import('*')
25    
26     #
27 jgs 235 # retreive command-line arguments if any
28 jgs 196
29 jgs 235 if ARGUMENTS.get('usegcc',0):
30     usegcc = 1
31 jgs 196
32 jgs 246 if ARGUMENTS.get('options',0):
33     options = ARGUMENTS.get('options',0)
34    
35 jgs 235 #
36     # determine platform
37    
38     env = Environment(ENV = os.environ)
39     platform = env['PLATFORM']
40    
41     #
42     # determine hostname
43    
44     hostname = os.environ['HOSTNAME']
45    
46     #
47     # load configuration settings
48    
49     options_dir = str(esysroot) + '/scons'
50     sys.path.append(options_dir)
51    
52 jgs 309 from default_options import *
53    
54 jgs 235 if hostname=='ess':
55     from ess_options import *
56    
57 jgs 241 if usegcc==1:
58     from gcc_options import *
59    
60 jgs 246 if options!=None:
61     exec "from " + options + " import *"
62    
63 jgs 235 cxx_flags=cxx_flags_debug
64    
65     #
66     # print out build configuration for this module
67    
68     print "Build configuration for module: DataArrayView unit tests"
69     print " dodebug: 1"
70     print " usegcc: ", usegcc
71     print " cxx: ", cxx
72     print " platform: ", platform
73     print " hostname: ", hostname
74    
75     #
76     # do the actual build
77    
78 jgs 196 dataarrayview_test_path = str(esysroot) + '/escript/test/DataArrayView'
79     escript_path = str(esysroot) + '/escript/inc'
80     esysUtils_path = str(esysroot) + '/esysUtils/inc'
81     CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc'
82    
83     esys_lib_path = str(esysroot) + '/lib'
84     esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'
85     CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib'
86    
87 jgs 288 escript_lib = str(esys_lib_path) + '/libescriptcpp.so'
88    
89     install_dir = str(esysroot) + '/escript/test'
90    
91 jgs 196 cpp_path = [dataarrayview_test_path,
92     escript_path,
93     esysUtils_path,
94     CppUnitTest_path,
95     python_path,
96     boost_path]
97    
98     lib_path = [esys_lib_path,
99     esysUtils_lib_path,
100     CppUnitTest_lib_path,
101     python_lib_path,
102     boost_lib_path]
103    
104     libs = ['escriptcpp',
105     'esysUtils',
106     'CppUnitTest',
107 jgs 239 str(python_lib),
108     str(boost_lib),
109 jgs 196 'dl',
110 jgs 252 'util']
111 jgs 196
112 jgs 252 libs.extend(sys_libs)
113    
114 jgs 196 sources = ['DataArrayViewTestCase.cpp',
115     'DataArrayViewTest.cpp']
116    
117     target = 'DataArrayViewTest.exe'
118    
119     dataarrayview_env = Environment(ENV = os.environ)
120    
121 jgs 235 dataarrayview_env.Replace(CXX = cxx)
122 jgs 196 dataarrayview_env.Replace(CXXFLAGS = cxx_flags)
123     dataarrayview_env.Replace(CPPPATH = cpp_path)
124     dataarrayview_env.Replace(LIBPATH = lib_path)
125     dataarrayview_env.Replace(LIBS = libs)
126    
127     dataarrayview_test_exe = dataarrayview_env.Program(target, sources)
128 jgs 288
129     Depends(dataarrayview_test_exe, escript_lib)
130    
131     dataarrayview_env.Install(install_dir, dataarrayview_test_exe)

  ViewVC Help
Powered by ViewVC 1.1.26