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

Contents of /trunk/dataexporter/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2818 - (show annotations)
Thu Dec 10 04:10:16 2009 UTC (9 years, 7 months ago) by caltinay
File size: 2883 byte(s)
dataexporter links against escript now to make the Mac happy.

1 ########################################################
2 #
3 # Copyright (c) 2003-2009 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
14 import os
15 Import('*')
16
17 local_env = clone_env(env_mpi)
18 py_wrapper_local_env = clone_env(env_mpi)
19
20 # Remove the shared library prefix on all platforms - we don't want 'lib'
21 # mucking with our python modules
22 del py_wrapper_local_env['SHLIBPREFIX']
23
24 sources = """
25 DataVar.cpp
26 ElementData.cpp
27 EscriptDataset.cpp
28 FileSavers.cpp
29 FinleyMesh.cpp
30 NodeData.cpp
31 """.split()
32
33 headers = """
34 DataVar.h
35 ElementData.h
36 EscriptDataset.h
37 escriptexport.h
38 FileSavers.h
39 FinleyMesh.h
40 NodeData.h
41 """.split()
42
43 local_env.AppendUnique(LIBS = ['finley', 'escript'] + env['sys_libs'])
44 if local_env['usesilo']:
45 local_env.AppendUnique(LIBS = [env['silo_libs']])
46
47 if IS_WINDOWS_PLATFORM :
48 local_env.Append(CPPDEFINES = ['ESCRIPTEXPORT_EXPORTS'])
49
50 module_name = 'escriptexport'
51
52 lib = local_env.SharedLibrary(module_name, sources)
53 env.Alias('target_escriptexport_so', lib)
54
55 include_path = Dir('escriptexport', local_env['incinstall'])
56
57 tmp1 = local_env.Install(include_path, headers)
58 env.Alias('target_install_escriptexport_headers', [tmp1])
59
60 tmp2 = local_env.Install(local_env['libinstall'], lib)
61 env.Alias('target_install_escriptexport_so', tmp2)
62
63 ### Python wrapper ###
64 py_wrapper_local_env.Append(LIBS = ['escriptexport'] + env['sys_libs'])
65 py_wrapper_name = module_name + 'cpp'
66 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'escriptexportcpp.cpp')
67 env.Alias('target_escriptexportcpp_so', py_wrapper_lib)
68
69 tmp_inst = os.path.join(local_env['pyinstall'], 'dataexporter')
70 #windows specific mod
71 if os.name == 'nt':
72 wrapper_postfix = '.pyd'
73 else:
74 wrapper_postfix = '.so'
75
76 share_name = os.path.join(tmp_inst, py_wrapper_name + wrapper_postfix)
77 tmp3 = py_wrapper_local_env.InstallAs(target=share_name,
78 source=py_wrapper_lib[0])
79 env.Alias('target_install_escriptexportcpp_so', tmp3)
80
81 # export the lib target since tests will depend on it
82 # the lib target is a list of file nodes (why? win32 produces more than one
83 # output file: .lib, .dll, .pdb)
84 # FIXME: This list handling produces the desired result but can this be done
85 # directly with scons File nodes?
86 dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
87 Export('dep_lib')
88
89 # Call the python SConscript
90 env.SConscript(dirs = ['#/dataexporter/py_src'], build_dir='py', duplicate=0)
91
92 # Call the unit tests SConscript
93 #local_env.SConscript(dirs = ['#/dataexporter/test'], build_dir='#/build/$PLATFORM/dataexporter/test', duplicate=0)
94

  ViewVC Help
Powered by ViewVC 1.1.26