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

Annotation of /trunk/ripley/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4035 - (hide annotations)
Thu Oct 25 03:10:14 2012 UTC (6 years, 10 months ago) by caltinay
File size: 2549 byte(s)
Tweaked scons files so tests work even when specifying non-absolute build_dir.

1 caltinay 3670
2 jfenwick 3982 ##############################################################################
3 caltinay 3670 #
4 caltinay 3781 # Copyright (c) 2003-2012 by University of Queensland
5 jfenwick 3982 # http://www.uq.edu.au
6 caltinay 3670 #
7     # Primary Business: Queensland, Australia
8     # Licensed under the Open Software License version 3.0
9     # http://www.opensource.org/licenses/osl-3.0.php
10     #
11 jfenwick 3982 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12     # Development since 2012 by School of Earth Sciences
13     #
14     ##############################################################################
15 caltinay 3670
16     import os
17     Import('*')
18    
19     local_env = env.Clone()
20     py_wrapper_local_env = env.Clone()
21     local_unroll_env = env.Clone()
22    
23    
24 caltinay 3791 # Remove the shared library prefix on all platforms - we don't want 'lib'
25     # mucking with our python modules
26 caltinay 3670 del py_wrapper_local_env['SHLIBPREFIX']
27    
28     sources = """
29 caltinay 3691 Brick.cpp
30     Rectangle.cpp
31 caltinay 3791 RipleyDomain.cpp
32 caltinay 3670 RipleyException.cpp
33     """.split()
34    
35     headers = """
36 caltinay 3691 Brick.h
37     Rectangle.h
38 caltinay 3670 Ripley.h
39 caltinay 3791 RipleyDomain.h
40 caltinay 3670 RipleyException.h
41     system_dep.h
42     """.split()
43    
44 caltinay 3740 local_env.Prepend(LIBS = ['pasowrap', 'escript', 'paso', 'esysUtils'])
45 caltinay 3691 if local_env['silo']:
46     local_env.Append(CPPDEFINES = ['USE_SILO'])
47     local_env.AppendUnique(LIBS = env['silo_libs'])
48 caltinay 3670
49     if IS_WINDOWS:
50     local_env.Append(CPPDEFINES = ['RIPLEY_EXPORTS'])
51    
52     module_name = 'ripley'
53    
54 caltinay 3791 lib = local_env.SharedLibrary(module_name, sources)
55 caltinay 3670 env.Alias('build_ripley_lib', lib)
56    
57     include_path = Dir('ripley', local_env['incinstall'])
58    
59     hdr_inst = local_env.Install(include_path, headers)
60     env.Alias('install_ripley_headers', hdr_inst)
61    
62     lib_inst = local_env.Install(local_env['libinstall'], lib)
63     env.Alias('install_ripley_lib', lib_inst)
64    
65     ### Python wrapper ###
66 caltinay 3740 py_wrapper_local_env.Prepend(LIBS = ['ripley', 'pasowrap', 'escript', 'paso', 'esysUtils'])
67 caltinay 3670 py_wrapper_name = module_name + 'cpp'
68     py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'ripleycpp.cpp')
69     env.Alias('build_ripleycpp_lib', py_wrapper_lib)
70    
71     tmp_inst = os.path.join(local_env['pyinstall'], module_name)
72     if IS_WINDOWS:
73     wrapper_ext = '.pyd'
74     else:
75     wrapper_ext = '.so'
76    
77     share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
78     mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
79     source=py_wrapper_lib[0])
80     env.Alias('install_ripleycpp_lib', mod_inst)
81    
82     # configure python module
83     local_env.SConscript(dirs = ['#/ripley/py_src'], variant_dir='py', duplicate=0)
84    
85     # configure unit tests
86 caltinay 4035 local_env.SConscript(dirs = ['#/ripley/test'], variant_dir='test', duplicate=0, exports=['py_wrapper_lib'])
87 caltinay 3670

  ViewVC Help
Powered by ViewVC 1.1.26