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

Contents of /trunk/pasowrap/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


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

1 ##############################################################################
2 #
3 # Copyright (c) 2003-2012 by University of Queensland
4 # http://www.uq.edu.au
5 #
6 # Primary Business: Queensland, Australia
7 # Licensed under the Open Software License version 3.0
8 # http://www.opensource.org/licenses/osl-3.0.php
9 #
10 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
11 # Development since 2012 by School of Earth Sciences
12 #
13 ##############################################################################
14
15 import os
16 Import('*')
17
18 local_env = env.Clone()
19 local_dodgy = dodgy_env.Clone()
20 py_wrapper_local_env = env.Clone()
21
22 # Remove the sharedlibrary prefix on all platform - we don't want 'lib'
23 # mucking with our python modules
24 del py_wrapper_local_env['SHLIBPREFIX']
25
26 sources = """
27 PasoException.cpp
28 SystemMatrixAdapter.cpp
29 TransportProblemAdapter.cpp
30 """.split()
31
32 headers = """
33 PasoException.h
34 SystemMatrixAdapter.h
35 TransportProblemAdapter.h
36 system_dep.h
37 """.split()
38
39 local_env.Prepend(LIBS = ['escript', 'paso', 'esysUtils'])
40 if IS_WINDOWS:
41 local_env.Append(CPPDEFINES = ['PASOWRAP_EXPORTS'])
42
43 module_name = 'pasowrap'
44
45 # specify to build shared object
46
47 lib = local_env.SharedLibrary(module_name, sources)
48 env.Alias('build_pasowrap_lib', lib)
49
50 include_path = Dir('pasowrap', local_env['incinstall'])
51 hdr_inst = local_env.Install(include_path, headers)
52 env.Alias('install_pasowrap_headers', hdr_inst)
53
54 lib_inst = local_env.Install(local_env['libinstall'], lib)
55 env.Alias('install_pasowrap_lib', lib_inst)
56
57 ### Python wrapper ###
58 if not env['build_shared']:
59 py_wrapper_local_env.Prepend(LIBS = ['pasowrap', 'escript', 'esysUtils'])
60 else:
61 py_wrapper_local_env.Prepend(LIBS = ['pasowrap', 'escript', 'paso', 'esysUtils'])
62 py_wrapper_name = module_name + 'cpp'
63 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'pasowrapcpp.cpp')
64 env.Alias('build_pasowrapcpp_lib', py_wrapper_lib)
65
66 tmp_inst = os.path.join(local_env['pyinstall'], module_name)
67 if IS_WINDOWS:
68 wrapper_ext = '.pyd'
69 else:
70 wrapper_ext = '.so'
71
72 share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
73 mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
74 source=py_wrapper_lib[0])
75 env.Alias('install_pasowrapcpp_lib', mod_inst)
76
77 # configure python module
78 local_env.SConscript(dirs = ['#/pasowrap/py_src'], variant_dir='py', duplicate=0)
79
80 # configure unit tests
81 #local_env.SConscript(dirs = ['#/pasowrap/test'], variant_dir='$BUILD_DIR/$PLATFORM/pasowrap/test', duplicate=0, exports=['py_wrapper_lib'])
82

  ViewVC Help
Powered by ViewVC 1.1.26