]> Creatis software - creaToolsTools.git/blob - Linux/scripts/CreaTools-compile.sh
Some more consistency checking...
[creaToolsTools.git] / Linux / scripts / CreaTools-compile.sh
1 #!/bin/bash
2
3 if [ ! -f $PWD/scripts/CreaTools-configure.sh ]
4 then 
5    echo
6    echo "..ERROR.."
7    echo "==================================================="
8    echo "REMEMBER !"
9    echo ""
10    echo "YOU NEED TO RUN 'Configure' (0) FIRST !"
11    echo "==================================================="
12    echo
13    echo
14    exit 0
15 fi
16
17 # Set all local variables
18  
19  source $PWD/scripts/CreaTools-configure.sh
20  source $PWD/scripts/CreaTools-names.sh
21
22    echo "------"
23    echo $PWD/scripts/CreaTools-configure.sh
24    echo --generationdir--
25    echo $generationdir
26    echo --docgeneration--
27    echo $docgeneration
28    echo --installPrefix--
29    echo $installPrefix
30    echo --buildType--
31    echo $buildType
32    echo --gdcmVersion--
33    echo $gdcmVersion
34    echo --sourcesFrom--
35    echo $sourcesFrom
36    echo --scriptDir--
37    echo $scriptDir
38    echo --start_point--
39    echo $start_point
40    echo "------"
41
42 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
43 then
44  echo missing  $installPrefixThird/share/creatools_third_party_library_config.sh
45    echo
46    echo "..ERROR.."
47    echo "==================================================="
48    echo "REMEMBER !"
49    echo ""
50    echo "YOU NEED TO RUN 'Install Third Party Libraries' (1) FIRST !"
51    echo "==================================================="
52    echo
53    echo "Hit any key to continue"
54    read a
55    exit 0
56 fi
57
58  if [ ! -e $generationdir/creatools_source ]
59  then 
60  echo missing  $generationdir/creatools_source
61    echo
62    echo "..ERROR.."
63    echo "==================================================="
64    echo "REMEMBER !"
65    echo ""
66    echo "YOU NEED TO RUN 'Load' (2) FIRST !"
67    echo "==================================================="
68    echo
69    echo
70    exit 0
71 fi
72
73
74 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
75 then
76  echo missing  $installPrefixThird/share/creatools_third_party_library_config.sh
77    echo
78    echo "..ERROR.."
79    echo "==================================================="
80    echo "REMEMBER !"
81    echo ""
82    echo "YOU NEED TO RUN 'Load' (2) FIRST !"
83    echo "==================================================="
84    echo
85    echo
86    exit 0
87 fi
88
89  cd $generationdir
90  if [ -e creatools_bin ]
91  then
92     rm -rf creatools_bin
93  fi
94  mkdir creatools_bin
95
96 cd $scriptDir
97
98 # -------------------------
99 #        start_point =  2 : CREA
100 #-------------------------
101 if [ $start_point -le 2 ]
102 then
103 # CREA
104 # the following stupid test is used at debug time; Please don't remove!
105 #if [ true = false ]
106 if [ true = true ]
107 then
108  bash $scriptDir/cmakemod.sh                  $creasource $generationdir $installPrefix $buildType 
109  bash $scriptDir/creaVariables.sh             $creasource $generationdir $docgeneration
110  bash $scriptDir/compilemod.sh     $buildType $creasource $generationdir
111  bash $scriptDir/ctestmod.sh                  $creasource $generationdir
112 fi
113 fi
114  creadll=$generationdir/creatools_bin/creaBin
115  LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH
116
117
118 # -------------------------
119 #        start_point =  3 : BBTK
120 #-------------------------
121 if [ $start_point -le 3 ]
122 then
123 # the following stupid test is used at debug time; Please don't remove!
124 #if [ true = false ]
125 if [ true = true ]
126 then
127 # BBTK
128 echo ========================================================= $bbtksource $generationdir $installPrefix $buildType
129  bash $scriptDir/cmakemod.sh               $bbtksource $generationdir $installPrefix $buildType
130  bash $scriptDir/bbtkVariables.sh          $bbtksource $generationdir $docgeneration $gdcmVersion
131  bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir
132  bash $scriptDir/ctestmod.sh               $bbtksource $generationdir
133 fi
134 fi
135  bbtkdll=$generationdir/creatools_bin/bbtkBin
136  LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
137
138
139 # -------------------------
140 #        start_point =  4 : creaMaracasVisu
141 #-------------------------
142 if [ $start_point -le 4 ]
143 then
144 # the following stupid test is used at debug time; Please don't remove!
145 #if [ true = false ]
146 if [ true = true ]
147 then
148 # creaMaracasVisu
149  bash $scriptDir/cmakemod.sh              $creamaracassource $generationdir $installPrefix $buildType 
150  bash $scriptDir/creaMaracasVariables.sh  $creamaracassource $generationdir $docgeneration
151  bash $scriptDir/compilemod.sh $buildType $creamaracassource $generationdir
152  bash $scriptDir/ctestmod.sh              $creamaracassource $generationdir
153 fi
154 fi
155  creamaracasdll=$generationdir/creatools_bin/creamaracasBin
156  LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_PATH
157
158
159 # -------------------------
160 #        start_point =  5 : creaEnvironment
161 #-------------------------
162 if [ $start_point -le 5 ]
163 then
164 # the following stupid test is used at debug time; Please don't remove!
165 #if [ true = false ]
166 if [ true = true ]
167 then
168 # creaEnvironment
169  bash $scriptDir/cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
170  bash $scriptDir/creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
171  bash $scriptDir/compilemod.sh $buildType    $creaenvironmentsource $generationdir
172  bash $scriptDir/ctestmod.sh                 $creaenvironmentsource $generationdir
173 fi
174 fi
175  creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
176  LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_PATH
177
178
179 # -------------------------
180 #        start_point =  6 : creaBruker
181 #-------------------------
182 if [ $start_point -le 6 ]
183 then
184 # the following stupid test is used at debug time; Please don't remove!
185 #if [ true = false ]
186 if [ true = true ]
187 then
188 # creaBruker
189  bash $scriptDir/cmakemod.sh              $creabrukersource $generationdir $installPrefix $buildType 
190  bash $scriptDir/creaBrukerVariables.sh   $creabrukersource $generationdir $docgeneration $gdcmVersion
191  bash $scriptDir/compilemod.sh $buildType $creabrukersource $generationdir
192  bash $scriptDir/ctestmod.sh              $creabrukersource $generationdir
193 fi
194 fi
195  creabrukerdll=$generationdir/creatools_bin/creabrukerBin
196  LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_PATH
197
198
199 # -------------------------
200 #        start_point =  7 : creaImageIO
201 #-------------------------
202 if [ $start_point -le 7 ]
203 then
204  # the following stupid test is used at debug time; Please don't remove!
205 #if [ true = false ]
206 if [ true = true ]
207 then
208 # creaImageIO
209  bash $scriptDir/cmakemod.sh              $creaimagesource $generationdir $installPrefix $buildType 
210  bash $scriptDir/creaImageIOVariables.sh  $creaimagesource $generationdir $docgeneration $gdcmVersion
211  bash $scriptDir/compilemod.sh $buildType $creaimagesource $generationdir
212  bash $scriptDir/ctestmod.sh              $creaimagesource $generationdir
213 fi
214 fi
215  creaimagedll=$generationdir/creatools_bin/creaimageBin
216  LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_PATH
217
218
219 # -------------------------
220 #        start_point =  8 : creaContour
221 #-------------------------
222 if [ $start_point -le 8 ]
223 then
224 # the following stupid test is used at debug time; Please don't remove!
225 #if [ true = false ]
226 if [ true = true ]
227 then
228 # creaContours
229  bash $scriptDir/cmakemod.sh              $creacontourssource $generationdir $installPrefix $buildType 
230  bash $scriptDir/creaContoursVariables.sh $creacontourssource $generationdir $docgeneration
231  bash $scriptDir/compilemod.sh $buildType $creacontourssource $generationdir
232  bash $scriptDir/ctestmod.sh              $creacontourssource $generationdir
233 fi
234 fi
235 # creacontourdll=$generationdir/creatools_bin/creacontoursBin
236 # LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_PATH
237
238
239 # -------------------------
240 #        start_point =  9 : creaRigidRegistration
241 #-------------------------
242 if [ $start_point -le 9 ]
243 then
244 # the following stupid test is used at debug time; Please don't remove!
245 #if [ true = false ]
246 if [ true = true ]
247 then
248  bash $scriptDir/cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
249  bash $scriptDir/creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration
250  bash $scriptDir/compilemod.sh            $buildType $crearigidregistrationssource $generationdir
251  bash $scriptDir/ctestmod.sh                         $crearigidregistrationssource $generationdir
252 fi
253 fi
254 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
255 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
256
257
258 # -------------------------
259 #        start_point =  10 : bbtkGEditor
260 #-------------------------
261 if [ $start_point -le 10 ]
262 then
263 # the following stupid test is used at debug time; Please don't remove!
264 #if [ true = false ]
265 if [ true = true ]
266 then
267 # bbtkGEditor
268  bash $scriptDir/cmakemod.sh              $bbtkgeditorsource $generationdir $installPrefix $buildType 
269  bash $scriptDir/bbtkGEditorVariables.sh  $bbtkgeditorsource $generationdir $docgeneration
270  bash $scriptDir/compilemod.sh $buildType $bbtkgeditorsource $generationdir
271  bash $scriptDir/ctestmod.sh              $bbtkgeditorsource $generationdir
272 fi
273 fi
274 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
275 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
276
277
278 # -------------------------
279 #        start_point =  11 : creaTools
280 #-------------------------
281 if [ $start_point -le 11 ]
282 then
283 # the following stupid test is used at debug time; Please don't remove!
284 #if [ true = false ]
285 if [ true = true ]
286 then
287 # creaTools
288  bash $scriptDir/cmakemod.sh                $creatoolssource $generationdir $installPrefix $buildType 
289  bash $scriptDir/creaToolsVariables.sh      $creatoolssource $generationdir $docgeneration
290  bash $scriptDir/compilemod.sh   $buildType $creatoolssource $generationdir
291 fi
292 fi
293
294
295 # bash ctestmod.sh $creatoolsbinary $generationdir
296 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
297 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
298
299 # shutdown /s
300 # exit /b