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

Contents of /trunk/weipa/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3259 - (show annotations)
Mon Oct 11 01:48:14 2010 UTC (8 years, 9 months ago) by jfenwick
File size: 3654 byte(s)
Merging dudley and scons updates from branches

1 ########################################################
2 #
3 # Copyright (c) 2003-2010 by University of Queensland
4 # Earth Systems Science Computational Center (ESSCC)
5 # http://www.uq.edu.au/esscc
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 ########################################################
12
13 import os
14 Import('*')
15
16 local_env = env.Clone()
17 py_wrapper_local_env = env.Clone()
18
19 # Remove the shared library prefix on all platforms - we don't want 'lib'
20 # mucking with our python modules
21 del py_wrapper_local_env['SHLIBPREFIX']
22
23 sources = """
24 DataVar.cpp
25 EscriptDataset.cpp
26 FileWriter.cpp
27 FinleyDomain.cpp
28 FinleyElements.cpp
29 FinleyNodes.cpp
30 VisItControl.cpp
31 """.split()
32
33 headers = """
34 DataVar.h
35 DomainChunk.h
36 ElementData.h
37 EscriptDataset.h
38 FileWriter.h
39 FinleyDomain.h
40 FinleyElements.h
41 FinleyNodes.h
42 NodeData.h
43 VisItControl.h
44 weipa.h
45 """.split()
46
47 if local_env['visit']:
48 sources.append(['VisItData.cpp'])
49 headers.append(['VisItData.h'])
50 local_env.Append(CPPDEFINES = ['USE_VISIT'])
51 local_env.AppendUnique(LIBS = ['simV2'])
52
53 local_env.Append(LIBS = ['finley', 'dudley','escript', 'esysUtils'])
54 if local_env['silo']:
55 local_env.Append(CPPDEFINES = ['USE_SILO'])
56 local_env.AppendUnique(LIBS = env['silo_libs'])
57
58 if IS_WINDOWS:
59 local_env.Append(CPPDEFINES = ['WEIPA_EXPORTS'])
60
61 module_name = 'weipa'
62
63 lib = local_env.SharedLibrary(module_name, sources)
64 env.Alias('build_weipa_lib', lib)
65
66 include_path = Dir('weipa', local_env['incinstall'])
67
68 hdr_inst = local_env.Install(include_path, headers)
69 env.Alias('install_weipa_headers', hdr_inst)
70
71 lib_inst = local_env.Install(local_env['libinstall'], lib)
72 env.Alias('install_weipa_lib', lib_inst)
73
74 ### Python wrapper ###
75 py_wrapper_local_env.Append(LIBS = ['weipa', 'dudley','finley', 'escript', 'esysUtils'])
76 py_wrapper_name = module_name + 'cpp'
77 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'weipacpp.cpp')
78 env.Alias('build_weipacpp_lib', py_wrapper_lib)
79
80 tmp_inst = os.path.join(local_env['pyinstall'], module_name)
81 if IS_WINDOWS:
82 wrapper_ext = '.pyd'
83 else:
84 wrapper_ext = '.so'
85
86 share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
87 mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
88 source=py_wrapper_lib[0])
89 env.Alias('install_weipacpp_lib', mod_inst)
90
91 ######################
92 ### Plugin library ###
93 ######################
94 # This is disabled on Windows since Scons complains about compiling the same
95 # files in the same build directory twice. The plugin is currently only for
96 # Linux anyway. Correct fix is probably a second SConscript file with different
97 # build_dir setting.
98 if not IS_WINDOWS:
99 visitplugin_env = env.Clone()
100 plugin_sources = """
101 DataVar.cpp
102 EscriptDataset.cpp
103 FinleyDomain.cpp
104 FinleyElements.cpp
105 FinleyNodes.cpp
106 """.split()
107
108 visitplugin_env.Append(LIBS = ['esysUtils' ])
109 visitplugin_env.Append(CPPDEFINES = ['VISIT_PLUGIN'])
110
111 plugin_lib = visitplugin_env.StaticLibrary('escriptreader', plugin_sources)
112 env.Alias('build_escriptreader_lib', plugin_lib)
113
114 tmp = local_env.Install(local_env['libinstall'], plugin_lib)
115 env.Alias('install_escriptreader_lib', tmp)
116
117 # configure python module
118 local_env.SConscript(dirs = ['#/weipa/py_src'], variant_dir='py', duplicate=0, exports=['py_wrapper_lib'])
119
120 # configure unit tests
121 local_env.SConscript(dirs = ['#/weipa/test'], variant_dir='#/build/$PLATFORM/weipa/test', duplicate=0)
122

  ViewVC Help
Powered by ViewVC 1.1.26