forked from JeffersonLab/hcana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConscript.py
40 lines (28 loc) · 1.23 KB
/
SConscript.py
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
###### Hall C Software Main SConscript File #####
###### Author: Edward Brash ([email protected]) June 2013
import os
import re
import SCons.Util
Import ('pbaseenv')
######## ROOT Dictionaries #########
roothcdict = pbaseenv.subst('$HC_DIR')+'/HallCDict.C'
roothcobj = pbaseenv.subst('$HC_SRC')+'/HallCDict.so'
hcheadersbase = Glob('src/*.h',exclude=['src/THcGlobals.h','src/HallC_LinkDef.h'])
cmd = "cat src/HallC_LinkDef.h_preamble > src/HallC_LinkDef.h"
os.system(cmd)
for hcheaderfile in hcheadersbase:
filename = '%s' % hcheaderfile
basefilename = filename.rsplit('.',1)
newbasefilename = basefilename[0].rsplit('/',1)
cmd1 = "echo '#pragma link C++ class %s+;' >> src/HallC_LinkDef.h" % newbasefilename[1]
os.system(cmd1)
cmd = "cat src/HallC_LinkDef.h_postamble >> src/HallC_LinkDef.h"
os.system(cmd)
hcheaders = Glob('src/*.h',exclude=['src/HallC_LinkDef.h'])+Glob('src/HallC_LinkDef.h')
pbaseenv.RootCint(roothcdict,hcheaders)
pbaseenv.SharedObject(target = roothcobj, source = roothcdict)
####### Start of main SConscript ###########
print ('LIBS = %s\n' % pbaseenv.subst('$LIBS'))
analyzer = pbaseenv.Program(target = 'hcana', source = 'src/main.o')
pbaseenv.Install('./bin',analyzer)
pbaseenv.Alias('install',['./bin'])