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

Diff of /trunk/esysUtils/src/SConscript

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

revision 1704 by phornby, Fri Jul 11 13:12:46 2008 UTC revision 1705 by ksteube, Thu Aug 14 05:56:40 2008 UTC
# Line 1  Line 1 
1    #
2    # $Id$
3    #
4    #######################################################
5    #
6    #           Copyright 2003-2007 by ACceSS MNRF
7    #       Copyright 2007 by University of Queensland
8    #
9    #                http://esscc.uq.edu.au
10    #        Primary Business: Queensland, Australia
11    #  Licensed under the Open Software License version 3.0
12    #     http://www.opensource.org/licenses/osl-3.0.php
13    #
14    #######################################################
15    #
16    
17  import os  import os
18  Import('*')  Import('*')
19    
20  local_env=env.Copy()  local_env = clone_env(env_mpi)
21    
22  # get the relevant file names:  sources = """
23  src_dir = local_env.Dir('.').srcnode().abspath      EsysAssertException.cpp
24  filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]      EsysException.cpp
25        esysExceptionTranslator.cpp
26  sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]  """.split()
27  headers = [x for x in filenames if os.path.splitext(x)[1] in ['.h']]  headers = """
28  # Filter out sources that should not be in the list automatically      EsysAssert.h
29        EsysAssertException.h
30        EsysException.h
31        EsysTypes.h
32        esys_malloc.h
33        esysExceptionTranslator.h
34        system_dep.h
35    """.split()
36    
37  lib_name = 'esysUtils'  lib_name = 'esysUtils'
38    
 local_env.Append(LIBS = [boost_lib, python_lib])  
   
   
39  lib = local_env.StaticLibrary(lib_name, sources)  lib = local_env.StaticLibrary(lib_name, sources)
40    env.Alias('target_esysUtils_a', lib)
41    
42  # NOTE: to use this you need to edit system_dep.h  include_path = Dir(lib_name, local_env['incinstall'])
 #       to switch on the declspecs.  
 #local_env.Append(CPPDEFINES = 'ESYSUTILS_EXPORTS')  
 #lib = local_env.SharedLibrary(lib_name, sources)  
43    
44  include_path = Dir(lib_name, incinstall)  tmp1 = local_env.Install(include_path, headers )
45    env.Alias('target_install_esysUtils_headers', [tmp1])
46    
47  local_env.Install(include_path, headers )  tmp3 = local_env.Install(local_env['libinstall'], lib)
48  local_env.Install(libinstall, lib)  env.Alias('target_install_esysUtils_a', tmp3)
49    
50  # Call the unit tests SConscript  # Call the unit tests SConscript
51  # export the lib target since tests will depend on it  # export the lib target since tests will depend on it
52  # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)  # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
53  # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?  # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
54    
55  dep_lib = [libinstall+'/'+str(x) for x in lib]  dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
56  Export('dep_lib')  Export('dep_lib')
57    
58  local_env.SConscript(dirs = ['#/esysUtils/test'], build_dir='#/build/$PLATFORM/esysUtils/test', duplicate=0)  local_env.SConscript(dirs = ['#/esysUtils/test'], build_dir='#/build/$PLATFORM/esysUtils/test', duplicate=0)
59    
   
 # add source files to release  
 release_srcfiles = [ env.File(x) for x in filenames ] + [env.File("SConscript"), ]  
 env.Zip(src_zipfile, release_srcfiles)  
 env.Tar(src_tarfile, release_srcfiles)  
   

Legend:
Removed from v.1704  
changed lines
  Added in v.1705

  ViewVC Help
Powered by ViewVC 1.1.26