/[escript]/trunk/escript/src/SConscript
ViewVC logotype

Annotation of /trunk/escript/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1139 - (hide annotations)
Mon May 14 05:12:53 2007 UTC (12 years, 5 months ago) by ksteube
File size: 2541 byte(s)
Finished renaming of boost_lib to boost_libs and boost_lib_path to boost_libs_path.

1 gross 700 import os
2 jgs 181 Import('*')
3    
4 robwdcock 682 local_env=env.Copy()
5     py_wrapper_local_env=env.Copy()
6     # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
7     del py_wrapper_local_env['SHLIBPREFIX']
8 jgs 181
9 robwdcock 682 lib_name = 'escript'
10     py_wrapper_name = lib_name+'cpp'
11     py_wrapper_source = py_wrapper_name+'.cpp'
12     py_wrapper_lib_name = py_wrapper_name
13 jgs 277
14 gross 700 # get the relevant file names:
15 robwdcock 682 src_dir = local_env.Dir('.').srcnode().abspath
16 gross 700 filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]
17 jgs 181
18 robwdcock 682 sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
19     headers = [x for x in filenames if os.path.splitext(x)[1] in ['.h']]
20 gross 700
21 robwdcock 682 # Filter out sources that should not be in the list automatically
22     sources.remove(py_wrapper_source) # FIXME: should probably refactor the source tree so the python wrapper isn't colocated with c++ sources
23 jgs 277
24 ksteube 1139 local_env.Append(LIBS = [boost_libs] + ['esysUtils'] + sys_libs )
25     py_wrapper_local_env.Append(LIBS = [boost_libs] + [ lib_name, 'esysUtils'] + sys_libs )
26 gross 1023 if useNetCDF == 'yes':
27 gross 1131 local_env.Append(LIBS = netCDF_libs)
28 gross 1063 local_env.Append(CPPDEFINES = [ 'USE_NETCDF' ])
29 gross 1131 if IS_WINDOWS_PLATFORM: local_env.Append(CPPDEFINES = [ 'DLL_NETCDF' ])
30     py_wrapper_local_env.Append(LIBS = netCDF_libs)
31 gross 1063 py_wrapper_local_env.Append(CPPDEFINES = [ 'USE_NETCDF' ])
32 jgs 190
33 gross 1023 local_env.Append(CPPDEFINES = [ 'ESCRIPT_EXPORTS'] )
34 woo409 757
35 robwdcock 682 lib = local_env.SharedLibrary(lib_name, sources)
36     py_wrapper_lib = py_wrapper_local_env.SharedLibrary( py_wrapper_lib_name, py_wrapper_source)
37 jgs 481
38 robwdcock 682 include_path = Dir(lib_name, incinstall)
39 jgs 181
40 robwdcock 682 local_env.Install(include_path, headers )
41     local_env.Install(libinstall, lib)
42     py_wrapper_local_env.Install(pyinstall+'/escript', py_wrapper_lib)
43 jgs 277
44 robwdcock 682 # export the lib target since tests will depend on it
45     # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
46     # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
47     dep_lib = [libinstall+'/'+str(x) for x in lib]
48     Export('dep_lib')
49 jgs 277
50 gross 700
51    
52     # add source files to release
53     release_srcfiles = [ env.File(x) for x in filenames ] + [env.File("SConscript"), ]
54     env.Zip(src_zipfile, release_srcfiles)
55 gross 1131 try:
56     env.Tar(src_tarfile, release_srcfiles)
57     except AttributeError:
58     pass
59 robwdcock 682 # Call the python sconscript
60     env.SConscript(dirs = ['#/escript/py_src'], build_dir='py', duplicate=0)
61 jgs 277
62 robwdcock 682 # Call the unit tests SConscript
63     local_env.SConscript(dirs = ['#/escript/test'], build_dir='#/build/$PLATFORM/escript/test', duplicate=0)

  ViewVC Help
Powered by ViewVC 1.1.26