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

Contents of /trunk/ripley/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3982 - (show annotations)
Fri Sep 21 03:23:22 2012 UTC (7 years ago) by jfenwick
File size: 2577 byte(s)
More edits + removing pyvisi from trunk

1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2012 by University of Queensland
5 # http://www.uq.edu.au
6 #
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 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development since 2012 by School of Earth Sciences
13 #
14 ##############################################################################
15
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 # Remove the shared library prefix on all platforms - we don't want 'lib'
25 # mucking with our python modules
26 del py_wrapper_local_env['SHLIBPREFIX']
27
28 sources = """
29 Brick.cpp
30 Rectangle.cpp
31 RipleyDomain.cpp
32 RipleyException.cpp
33 """.split()
34
35 headers = """
36 Brick.h
37 Rectangle.h
38 Ripley.h
39 RipleyDomain.h
40 RipleyException.h
41 system_dep.h
42 """.split()
43
44 local_env.Prepend(LIBS = ['pasowrap', 'escript', 'paso', 'esysUtils'])
45 if local_env['silo']:
46 local_env.Append(CPPDEFINES = ['USE_SILO'])
47 local_env.AppendUnique(LIBS = env['silo_libs'])
48
49 if IS_WINDOWS:
50 local_env.Append(CPPDEFINES = ['RIPLEY_EXPORTS'])
51
52 module_name = 'ripley'
53
54 lib = local_env.SharedLibrary(module_name, sources)
55 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 py_wrapper_local_env.Prepend(LIBS = ['ripley', 'pasowrap', 'escript', 'paso', 'esysUtils'])
67 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 local_env.SConscript(dirs = ['#/ripley/test'], variant_dir='$BUILD_DIR/$PLATFORM/ripley/test', duplicate=0, exports=['py_wrapper_lib'])
87

  ViewVC Help
Powered by ViewVC 1.1.26