forked from xray-group/mstruct
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSConscript.cctbx
More file actions
44 lines (41 loc) · 1.5 KB
/
SConscript.cctbx
File metadata and controls
44 lines (41 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Import('env')
# Determine if we should use shared installation of cctbx
if 'with_shared_cctbx' in env:
has_shared_cctbx = env['with_shared_cctbx']
else:
conf = Configure(env)
has_shared_cctbx = conf.CheckLibWithHeader('cctbx', '''
cctbx/sgtbx/space_group.h
cctbx/miller/sym_equiv.h
cctbx/miller/index_generator.h
cctbx/eltbx/wavelengths.h
cctbx/eltbx/xray_scattering.h
cctbx/eltbx/tiny_pse.h
cctbx/eltbx/icsd_radii.h
cctbx/eltbx/henke.h
cctbx/eltbx/neutron.h
cctbx/sgtbx/brick.h
'''.split(), language='C++', autoadd=False)
env = conf.Finish()
# reuse the installed cctbx library if available
if has_shared_cctbx:
env.AppendUnique(LIBS='cctbx')
# otherwise link in the included cctbx sources
else:
# Define the what we need for the cctbx
cctbxenv = env.Clone()
# Source path
cctbxenv.PrependUnique(CPPPATH = ["./cctbx/include"])
# Idenfity the required source files
srcfiles = Glob("./cctbx/cctbx/eltbx/*.cpp")
srcfiles += Glob("./cctbx/cctbx/eltbx/xray_scattering/*.cpp")
srcfiles += Glob("./cctbx/cctbx/sgtbx/*.cpp")
srcfiles += Glob("./cctbx/cctbx/sgtbx/reference_settings/*.cpp")
srcfiles += Glob("./cctbx/cctbx/miller/*.cpp")
srcfiles += Glob("./cctbx/cctbx/uctbx/*.cpp")
# Make the library object
objects = cctbxenv.SharedObject(srcfiles)
Clean(objects, "cctbx")
# Put this back into the global environment
env["cctbxobjs"] = objects
# vim: ft=python