-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMake.pl
executable file
·280 lines (233 loc) · 6.53 KB
/
CMake.pl
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
#!/usr/bin/perl -w
## use lib "/home/ansell/exe/getMk";
use lib "./";
use CMakeList;
require "CMakeSupport.pm";
use strict;
## EXECUTABLES
my @masterProg=getAllMain();
# ("example","fullBuild","ess","muBeam",
# "pipe","photonMod2","t1Real",
# "sns","saxs","reactor","essBeamline","bilbau",
# "singleItem","maxiv","testMain");
# filter
## Model Directory
##my @modelLibDir=qw( bibBuild build
## cuBlock d4cModel delft epbBuild essBuild
## lensModel t2Build
## muon pipeBuild photon sinbadBuild snsBuild t1Build
## );
##my @modelNames= @modelLibDir;
## INCLUDES
my @incdir=qw( include beamlineInc globalInc instrumentInc
scatMatInc specialInc transportInc testInclude );
my @mainLib=qw( visit src simMC construct
physics input generalProcess objectMod
transport scatMat endf crystal source monte funcBase log monte
flukaProcess flukaPhysics flukaTally
phitsProcess phitsTally phitsSupport
tally geometry src world work
xml poly support weights
insertUnit md5 construct modelSupport
global constructVar physics simMC
transport attachComp visit poly
magnetic phitsPhysics mcnpProcess
scatMat endf crystal );
my $gM=new CMakeList;
$gM->setParameters(\@ARGV);
$gM->addMasterProgs(\@masterProg);
$gM->addIncDir("",\@incdir);
$gM->findSubIncDir("System");
$gM->findSubIncDir("Model");
$gM->findSubIncDir("Model/ESSBeam");
$gM->findSubIncDir("Model/MaxIV");
$gM->findSubIncDir("Model/ralBuild");
$gM->findSubSrcDir("Model");
$gM->findSubSrcDir("System");
$gM->findSubSrcDir("Model/ESSBeam");
$gM->findSubSrcDir("Model/MaxIV");
$gM->findSubSrcDir("Model/ralBuild");
$gM->findSubSrcDir("","Aunit"); ## Aunit to be excluded
foreach my $mainProg (@masterProg)
{
if ($mainProg eq "ess")
{
my @ess = qw( essBuild );
my @essSupport = qw( essConstruct commonVar common
beer bifrost cspec dream estia
freia heimdal loki magic miracles
nmx nnbar odin skadi testBeam
trex vor vespa
simpleItem beamline instrument );
push(@ess,@mainLib);
$gM->addDepUnit("ess", [@ess,@essSupport]);
}
elsif ($mainProg eq "essBeamline")
{
my @essBeam = qw( essBuild );
my @essSupport = qw( essConstruct commonVar common
beer bifrost cspec dream estia
freia heimdal loki magic miracles
nmx nnbar odin skadi testBeam
trex vor vespa
simpleItem beamline instrument );
push(@essBeam,@mainLib);
$gM->addDepUnit("essBeamline", [@essBeam,@essSupport]);
}
elsif ($mainProg eq "example")
{
my @example = qw( exampleBuild );
push(@example,@mainLib);
$gM->addDepUnit("example", [@example]);
}
elsif ($mainProg eq "xrayHut")
{
my @hut = qw( xrayHutch );
push(@hut,@mainLib);
$gM->addDepUnit("xrayHut", [@hut]);
}
elsif ($mainProg eq "maxiv")
{
my @maxiv = qw( maxivBuild );
push(@maxiv,@mainLib);
$gM->addDepUnit("maxiv", [@maxiv,
qw(balder cosaxs danmax R3Common
flexpes formax maxpeem micromax
softimax
commonGenerator commonBeam Linac
R3Common R1Common species)]);
}
elsif ($mainProg eq "essLinac")
{
my @essBeam = qw( essLinac );
push(@essBeam,@mainLib);
$gM->addDepUnit("essLinac", [@essBeam]),
}
elsif ($mainProg eq "bilbau")
{
my @bilbau = qw( bibBuild );
push(@bilbau,@mainLib);
$gM->addDepUnit("bilbau", [@bilbau]),
}
elsif ($mainProg eq "fullBuild")
{
my @fullBuild = qw( t2Build ralBuild ralVar);
push(@fullBuild,@mainLib);
$gM->addDepUnit("fullBuild", [@fullBuild]),
}
elsif ($mainProg eq "d4c")
{
my @d4c = qw( d4cModel ) ;
push(@d4c,@mainLib);
$gM->addDepUnit("d4c", [@d4c]);
}
elsif ($mainProg eq "lens")
{
my @lens = qw( lensModel ) ;
push(@lens,@mainLib);
$gM->addDepUnit("lens", [@lens]);
}
elsif ($mainProg eq "simple")
{
$gM->addDepUnit("simple", [@mainLib]);
}
elsif ($mainProg eq "photonMod")
{
my @photonMod = qw( photon ) ;
push(@photonMod,@mainLib);
$gM->addDepUnit("photonMod", [@photonMod]);
}
elsif ($mainProg eq "photonMod2")
{
my @photonMod2 = qw( photon ) ;
push(@photonMod2,@mainLib);
$gM->addDepUnit("photonMod2", [@photonMod2]);
}
elsif ($mainProg eq "photonMod3")
{
my @photonMod3 = qw( photon ) ;
push(@photonMod3,@mainLib);
$gM->addDepUnit("photonMod3", [@photonMod3]);
}
elsif ($mainProg eq "pipe")
{
my @pipe = qw( pipeBuild ) ;
push(@pipe,@mainLib);
$gM->addDepUnit("pipe", [@pipe]);
}
elsif ($mainProg eq "singleItem")
{
my @singleItem = qw( singleItemBuild ) ;
push(@singleItem,@mainLib);
$gM->addDepUnit("singleItem",
[@singleItem,
qw( essConstruct commonVar commonGenerator
R1Common R3Common commonBeam Linac
beamline softimax formax)]);
}
elsif ($mainProg eq "t1Real")
{
my @t1Real = qw( t1Build ralBuild ralVar ) ;
push(@t1Real,@mainLib);
$gM->addDepUnit("t1Real", [@t1Real]);
}
elsif ($mainProg eq "reactor")
{
my @reactor = qw( delft ) ;
push(@reactor,@mainLib);
$gM->addDepUnit("reactor", [@reactor]);
}
elsif ($mainProg eq "siMod")
{
$gM->addDepUnit("siMod", \@mainLib);
}
elsif ($mainProg eq "cuBuild")
{
my @cuBuild = qw( cuBlock delft ) ;
push(@cuBuild,@mainLib);
$gM->addDepUnit("cuBuild", [@cuBuild]);
}
elsif ($mainProg eq "sinbad")
{
my @sinbad = qw( sinbadBuild ) ;
push(@sinbad,@mainLib);
$gM->addDepUnit("sinbad", [@sinbad]);
}
elsif ($mainProg eq "sns")
{
my @sns = qw( snsBuild ralBuild ) ;
push(@sns,@mainLib);
$gM->addDepUnit("sns", [@sns]);
}
elsif ($mainProg eq "epb")
{
my @epb = qw( epbBuild ) ;
push(@epb,@mainLib);
$gM->addDepUnit("epb", [@epb]);
}
elsif ($mainProg eq "muBeam")
{
my @muBeam = qw( muon ) ;
push(@muBeam,@mainLib);
$gM->addDepUnit("muBeam", [@muBeam]);
}
elsif ($mainProg eq "saxs")
{
my @saxs = qw( saxs d4cModel instrument );
push(@saxs,@mainLib);
$gM->addDepUnit("saxs", [@saxs]),
}
elsif ($mainProg eq "testMain")
{
my @testMain = qw( test ) ;
push(@testMain,@mainLib);
$gM->addDepUnit("testMain", [@testMain]);
}
else
{
print STDERR "FAILURE : UNKNOWN Main file ::: ",$mainProg,"\n";
}
}
$gM->writeCMake();
print "FINISH CMake.pl\n";
exit 0;