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

Contents of /trunk/weipa/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: 4091 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 py_wrapper_local_env = env.Clone()
20
21 # Remove the shared library prefix on all platforms - we don't want 'lib'
22 # mucking with our python modules
23 del py_wrapper_local_env['SHLIBPREFIX']
24
25 sources = """
26 DataVar.cpp
27 EscriptDataset.cpp
28 FileWriter.cpp
29 FinleyDomain.cpp
30 FinleyElements.cpp
31 FinleyNodes.cpp
32 RipleyDomain.cpp
33 RipleyElements.cpp
34 RipleyNodes.cpp
35 VisItControl.cpp
36 """.split()
37
38 headers = """
39 DataVar.h
40 DomainChunk.h
41 ElementData.h
42 EscriptDataset.h
43 FileWriter.h
44 FinleyDomain.h
45 FinleyElements.h
46 FinleyNodes.h
47 NodeData.h
48 RipleyDomain.h
49 RipleyElements.h
50 RipleyNodes.h
51 VisItControl.h
52 vtkCellType.h
53 weipa.h
54 """.split()
55
56 if local_env['visit']:
57 sources.append(['VisItData.cpp'])
58 headers.append(['VisItData.h'])
59 local_env.Append(CPPDEFINES = ['USE_VISIT'])
60 local_env.AppendUnique(LIBS = ['simV2'])
61
62 if not env['build_shared']:
63 local_env.Prepend(LIBS = ['ripley', 'finley', 'dudley', 'escript'])
64 else:
65 local_env.Prepend(LIBS = ['ripley', 'finley', 'dudley', 'escript', 'esysUtils'])
66
67 if local_env['silo']:
68 local_env.Append(CPPDEFINES = ['USE_SILO'])
69 local_env.AppendUnique(LIBS = env['silo_libs'])
70
71 if IS_WINDOWS:
72 local_env.Append(CPPDEFINES = ['WEIPA_EXPORTS'])
73
74 module_name = 'weipa'
75
76 lib = local_env.SharedLibrary(module_name, sources)
77 env.Alias('build_weipa_lib', lib)
78
79 include_path = Dir('weipa', local_env['incinstall'])
80
81 hdr_inst = local_env.Install(include_path, headers)
82 env.Alias('install_weipa_headers', hdr_inst)
83
84 lib_inst = local_env.Install(local_env['libinstall'], lib)
85 env.Alias('install_weipa_lib', lib_inst)
86
87 ### Python wrapper ###
88 if not env['build_shared']:
89 py_wrapper_local_env.Prepend(LIBS = ['weipa', 'ripley', 'finley', 'dudley', 'escript'])
90 else:
91 py_wrapper_local_env.Prepend(LIBS = ['weipa', 'ripley', 'finley', 'dudley', 'escript', 'esysUtils'])
92
93 py_wrapper_name = module_name + 'cpp'
94 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'weipacpp.cpp')
95 env.Alias('build_weipacpp_lib', py_wrapper_lib)
96
97 tmp_inst = os.path.join(local_env['pyinstall'], module_name)
98 if IS_WINDOWS:
99 wrapper_ext = '.pyd'
100 else:
101 wrapper_ext = '.so'
102
103 share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
104 mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
105 source=py_wrapper_lib[0])
106 env.Alias('install_weipacpp_lib', mod_inst)
107
108 ######################
109 ### Plugin library ###
110 ######################
111 visitplugin_env = env.Clone()
112 plugin_sources = """
113 DataVar.cpp
114 EscriptDataset.cpp
115 FinleyDomain.cpp
116 FinleyElements.cpp
117 FinleyNodes.cpp
118 """.split()
119
120 visitplugin_env.Prepend(LIBS = ['esysUtils'])
121 visitplugin_env.Append(CPPDEFINES = ['VISIT_PLUGIN'])
122 visitplugin_env['OBJPREFIX']='reader_'
123
124 if env['build_shared']:
125 plugin_lib = visitplugin_env.SharedLibrary('escriptreader', plugin_sources)
126 else:
127 if IS_WINDOWS:
128 visitplugin_env.Append(CPPDEFINES = ['WEIPA_STATIC_LIB'])
129 plugin_lib = visitplugin_env.StaticLibrary('escriptreader', plugin_sources)
130 env.Alias('build_escriptreader_lib', plugin_lib)
131
132 tmp = local_env.Install(local_env['libinstall'], plugin_lib)
133 env.Alias('install_escriptreader_lib', tmp)
134
135 # configure python module
136 local_env.SConscript(dirs = ['#/weipa/py_src'], variant_dir='py', duplicate=0, exports=['py_wrapper_lib'])
137
138 # configure unit tests
139 local_env.SConscript(dirs = ['#/weipa/test'], variant_dir='$BUILD_DIR/$PLATFORM/weipa/test', duplicate=0)
140

  ViewVC Help
Powered by ViewVC 1.1.26