/[escript]/branches/diaplayground/weipa/src/SConscript
ViewVC logotype

Contents of /branches/diaplayground/weipa/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5147 - (show annotations)
Fri Sep 12 00:33:02 2014 UTC (4 years, 8 months ago) by caltinay
File size: 4278 byte(s)
merge to latest trunk.

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

  ViewVC Help
Powered by ViewVC 1.1.26