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

Contents of /trunk/weipa/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6124 - (show annotations)
Tue Apr 5 03:23:12 2016 UTC (3 years ago) by caltinay
File size: 3602 byte(s)
Fixing python module build on OS X. Added PythonModule builder so we do this generically now.
1 ##############################################################################
2 #
3 # Copyright (c) 2003-2016 by The University of Queensland
4 # http://www.uq.edu.au
5 #
6 # Primary Business: Queensland, Australia
7 # Licensed under the Apache License, version 2.0
8 # http://www.apache.org/licenses/LICENSE-2.0
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('*')
17
18 module_name = 'weipa'
19
20 sources = """
21 DataVar.cpp
22 EscriptDataset.cpp
23 VisItControl.cpp
24 """.split()
25
26 headers = """
27 DataVar.h
28 DomainChunk.h
29 ElementData.h
30 EscriptDataset.h
31 NodeData.h
32 VisItControl.h
33 vtkCellType.h
34 weipa.h
35 """.split()
36
37 local_env = env.Clone()
38
39 if 'dudley' in env['domains'] or 'finley' in env['domains']:
40 sources += ['FinleyDomain.cpp','FinleyElements.cpp','FinleyNodes.cpp']
41 headers += ['FinleyDomain.h','FinleyElements.h','FinleyNodes.h']
42 if 'dudley' in env['domains']:
43 local_env.Append(CPPDEFINES = ['USE_DUDLEY'])
44 local_env.Prepend(LIBS = ['dudley'])
45 if 'finley' in env['domains']:
46 local_env.Append(CPPDEFINES = ['USE_FINLEY'])
47 local_env.Prepend(LIBS = ['finley'])
48
49 if 'ripley' in env['domains']:
50 sources += ['RipleyDomain.cpp','RipleyElements.cpp','RipleyNodes.cpp']
51 headers += ['RipleyDomain.h','RipleyElements.h','RipleyNodes.h']
52 local_env.Append(CPPDEFINES = ['USE_RIPLEY'])
53 local_env.Prepend(LIBS = ['ripley'])
54
55 if 'speckley' in env['domains']:
56 sources += ['SpeckleyDomain.cpp','SpeckleyElements.cpp','SpeckleyNodes.cpp']
57 headers += ['SpeckleyDomain.h','SpeckleyElements.h','SpeckleyNodes.h']
58 local_env.Append(CPPDEFINES = ['USE_SPECKLEY'])
59 local_env.Prepend(LIBS = ['speckley'])
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 local_env['silo']:
68 local_env.Append(CPPDEFINES = ['USE_SILO'])
69 local_env.AppendUnique(LIBS = env['silo_libs'])
70
71 local_env.Prepend(LIBS = ['escript'])
72
73 if IS_WINDOWS:
74 local_env.Append(CPPDEFINES = ['WEIPA_EXPORTS'])
75
76 include_path = Dir(module_name, local_env['incinstall'])
77 hdr_inst = local_env.Install(include_path, headers)
78
79 lib = local_env.SharedLibrary(module_name, sources)
80 lib_inst = local_env.Install(local_env['libinstall'], lib)
81
82 ### Python wrapper ###
83 py_env = local_env.Clone()
84 py_env.Prepend(LIBS = [module_name])
85 py_lib_name = module_name + 'cpp'
86 py_lib = py_env.PythonModule(py_lib_name, 'weipacpp.cpp')
87
88 mod_path = Dir(module_name, local_env['pyinstall'])
89 mod_inst = py_env.Install(mod_path, py_lib)
90
91 build = env.Alias('build_weipa', [hdr_inst, lib, py_lib])
92 env.Alias('install_weipa', [build, lib_inst, mod_inst])
93
94 ######################
95 ### Plugin library ###
96 ######################
97 visitplugin_env = env.Clone()
98 plugin_sources = """
99 DataVar.cpp
100 EscriptDataset.cpp
101 FinleyDomain.cpp
102 FinleyElements.cpp
103 FinleyNodes.cpp
104 """.split()
105
106 visitplugin_env.Prepend(LIBS = ['escript'])
107 visitplugin_env.Append(CPPDEFINES = ['VISIT_PLUGIN', 'USE_FINLEY'])
108 visitplugin_env['OBJPREFIX']='reader_'
109
110 plugin_lib = visitplugin_env.SharedLibrary('escriptreader', plugin_sources)
111 plugin_inst = local_env.Install(local_env['libinstall'], plugin_lib)
112
113 build = env.Alias('build_escriptreader', plugin_lib)
114 env.Alias('install_escriptreader', [build, plugin_inst])
115

  ViewVC Help
Powered by ViewVC 1.1.26