Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
SConscript.py
Go to the documentation of this file.
1
3
4import os
5from configure import FindROOT
6Import('dcenv')
7
8thisdir_fullpath = Dir('.').path
9thisdir = os.path.basename(os.path.normpath(thisdir_fullpath))
10
11# Executables
12appnames = ['tstfadc', 'tstfadcblk', 'tstf1tdc', 'tstio',
13 'tstoo', 'tdecpr', 'prfact', 'epicsd', 'tdecex',
14 'tst1190']
15apps = []
16sources = []
17env = dcenv.Clone()
18# Link only with decoder 'libdc', not EVIO or any other libs
19env.Replace(LIBS = ['dc'])
20env.Replace(LIBPATH = [env.subst('$HA_DC')])
21env.Replace(RPATH = [env.subst('$HA_DC')])
22# Also need to link with ROOT - can be made more elegant by
23# setting up a ROOT-only aware environment in parent project
24FindROOT(env)
25# SCons seems to ignore $RPATH on macOS... sigh
26if env['PLATFORM'] == 'darwin':
27 try:
28 for rp in env['RPATH']:
29 env.Append(LINKFLAGS = ['-Wl,-rpath,'+rp])
30 except KeyError:
31 pass
32
33for a in appnames:
34 if a == 'epicsd':
35 src = ['epics_main.cxx']
36 else:
37 src = [a+'_main.cxx']
38 if a == 'tdecex':
39 src.append('THaGenDetTest.cxx')
40
41 app = env.Program(target = a, source = src)
42 apps.append(app)
43 sources.append(src)
44
45# Installation
46install_prefix = env.subst('$INSTALLDIR')
47bin_dir = os.path.join(install_prefix,'bin')
48#lib_dir = os.path.join(install_prefix,'lib')
49rel_lib_dir = os.path.join(env['RPATH_ORIGIN_TAG'],
50 os.path.join('..',env.subst('$LIBSUBDIR')))
51src_dir = os.path.join(install_prefix,os.path.join('src',thisdir_fullpath))
52
53env.InstallWithRPATH(bin_dir,apps,[rel_lib_dir])
54env.Install(src_dir,sources)