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

Diff of /trunk/bruce/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 481 by jgs, Wed Feb 1 05:57:50 2006 UTC revision 682 by robwdcock, Mon Mar 27 02:43:09 2006 UTC
# Line 1  Line 1 
 libinstall = None  
 incinstall = None  
   
1  Import('*')  Import('*')
2    
3  import os  local_env=env.Copy()
4  import string  py_wrapper_local_env=env.Copy()
5    # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
6  libname = 'brucecpp'  del py_wrapper_local_env['SHLIBPREFIX']
7    
8  bruce_path = str(esysroot) + '/bruce/src'  lib_name = 'bruce'
9  escript_path = str(esysroot) + '/escript/src'  py_wrapper_name = lib_name+'cpp'
10  esysUtils_path = str(esysroot) + '/esysUtils/src'  py_wrapper_source = py_wrapper_name+'.cpp'
11    py_wrapper_lib_name = py_wrapper_name
 esys_lib_path = str(esysroot) + '/lib'  
 esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'  
   
 escript_lib = str(esys_lib_path) + '/libescriptcpp.so'  
 esysUtils_lib = str(esysUtils_lib_path) + '/libesysUtils.a'  
   
 cpp_path = [bruce_path,  
             escript_path,  
             esysUtils_path,  
             python_path,  
             boost_path]  
   
 incs = ['BruceException.h',  
         'BruceFactory.h',  
         'Bruce.h',  
         'vtkCellType.h']  
12    
13  sources = ['Bruce.cpp',  src_dir = local_env.Dir('.').srcnode().abspath
            'BruceFactory.cpp',  
            'brucecpp.cpp']  
14    
15  lib_path = [esys_lib_path,  import os
16              esysUtils_lib_path,  filenames = os.listdir(src_dir)
17              boost_lib_path]  sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
18    headers = [x for x in filenames if os.path.splitext(x)[1] in ['.h']]
19  libs = ['esysUtils',  # Filter out sources that should not be in the list automatically
20          'escriptcpp',  # Filter out sources that should not be in the list automatically
21          str(boost_lib)]  sources.remove(py_wrapper_source) # FIXME: should probably refactor the source tree so the python wrapper isn't colocated with c++ sources
22    
23  libs.extend(sys_libs)  local_env.Append(LIBS = [boost_lib, 'escript', 'esysUtils'])
24    py_wrapper_local_env.Append(LIBS = [boost_lib, lib_name, 'escript', 'esysUtils'])
25  bruce_env = Environment(ENV = os.environ)  
26    lib = local_env.SharedLibrary(lib_name, sources)
27  bruce_env.Replace(CXX = cxx)  py_wrapper_lib = py_wrapper_local_env.SharedLibrary( py_wrapper_lib_name, py_wrapper_source)
28  bruce_env.Replace(SHOBJSUFFIX = '.lo')  
29  bruce_env.Replace(CXXFLAGS = cxx_flags)  include_path = Dir(lib_name, incinstall)
30  bruce_env.Replace(CPPPATH = cpp_path)  
31  bruce_env.Replace(LIBPATH = lib_path)  local_env.Install(include_path, headers )
32  bruce_env.Replace(LIBS = libs)  local_env.Install(libinstall, lib)
33    py_wrapper_local_env.Install(pyinstall+'/bruce', py_wrapper_lib)
34  bruce_lib = bruce_env.SharedLibrary(libname, sources)  
35    # export the lib target since tests will depend on it
36  Depends(bruce_lib, esysUtils_lib)  # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
37  Depends(bruce_lib, escript_lib)  # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
38    dep_lib = [libinstall+'/'+str(x) for x in lib]
39    Export('dep_lib')
40    
41  Default(bruce_env.Install(incdir, incs))  # Call the python sconscript
42  Default(bruce_env.Install(incdir2, incs))  env.SConscript(dirs = ['#/bruce/py_src'], build_dir='py', duplicate=0)
 if incinstall != None:  
   Default(bruce_env.Install(incinstall, incs))  
43    
44  Default(bruce_env.Install(libdir, bruce_lib))  # Call the unit tests SConscript
45  Default(bruce_env.Install(libdir2, bruce_lib))  local_env.SConscript(dirs = ['#/bruce/test'], build_dir='#/build/$PLATFORM/bruce/test', duplicate=0)
 if libinstall != None:  
   Default(bruce_env.Install(libinstall, bruce_lib))  

Legend:
Removed from v.481  
changed lines
  Added in v.682

  ViewVC Help
Powered by ViewVC 1.1.26