]> Creatis software - creaToolsTools.git/blob - Linux/scripts/CreaTools-compile.sh
last patch for creatools installation on MacOSX
[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 --corenumber--
27    echo $corenumber   
28    echo --docgeneration--
29    echo $docgeneration
30    echo --installPrefix--
31    echo $installPrefix
32    echo --installPrefixThird--
33    echo $installPrefixThird   
34    echo --buildType-- 
35    echo $buildType
36    echo --gdcmVersion--
37    echo $gdcmVersion
38    echo --sourcesFrom--
39    echo $sourcesFrom
40    echo --scriptDir--
41    echo $scriptDir
42    echo --start_point--
43    echo $start_point
44    echo "------"
45
46 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
47 then
48  echo missing  $installPrefixThird/share/creatools_third_party_library_config.sh
49    echo
50    echo "..ERROR.."
51    echo "==================================================="
52    echo "REMEMBER !"
53    echo ""
54    echo "YOU NEED TO RUN 'Install Third Party Libraries' (1) FIRST !"
55    echo "==================================================="
56    echo
57    echo "Hit any key to continue"
58    read a
59    exit 0
60 fi
61
62  if [ ! -e $generationdir/creatools_source ]
63  then 
64  echo missing  $generationdir/creatools_source
65    echo
66    echo "..ERROR.."
67    echo "==================================================="
68    echo "REMEMBER !"
69    echo ""
70    echo "YOU NEED TO RUN 'Load' (2) FIRST !"
71    echo "==================================================="
72    echo
73    echo
74    exit 0
75 fi
76
77
78 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
79 then
80  echo missing  $installPrefixThird/share/creatools_third_party_library_config.sh
81    echo
82    echo "..ERROR.."
83    echo "==================================================="
84    echo "REMEMBER !"
85    echo ""
86    echo "YOU NEED TO RUN 'Load' (2) FIRST !"
87    echo "==================================================="
88    echo
89    echo
90    exit 0
91 fi
92
93  cd $generationdir
94  if [ -e creatools_bin ]
95  then
96     rm -rf creatools_bin
97  fi
98  mkdir creatools_bin
99
100 cd $scriptDir
101
102 # -------------------------
103 #        start_point =  2 : CREA
104 #-------------------------
105 if [ $start_point -le 2 ]
106 then
107 # CREA
108 # the following stupid test is used at debug time; Please don't remove!
109 #if [ true = false ]
110 if [ true = true ]
111 then
112  bash $scriptDir/cmakemod.sh                  $creasource $generationdir $installPrefix $buildType 
113  bash $scriptDir/creaVariables.sh             $creasource $generationdir $docgeneration
114  bash $scriptDir/compilemod.sh     $buildType $creasource $generationdir $corenumber
115  bash $scriptDir/ctestmod.sh                  $creasource $generationdir
116 fi
117 fi
118  creadll=$generationdir/creatools_bin/creaBin
119  if [ $OperatingSystem = "MacOS" ]
120  then
121   #duplicate form creaTools_name.sh?? //FCY
122     DYLD_LIBRARY_PATH=$creadll:$DYLD_LIBRARY_$PATH 
123  else
124     LD_LIBRARY_PATH=$creadll:$LD_LIBRARY_$PATH
125  fi
126  export crea_DIR=$generationdir/creatools_bin/creaBin
127
128 # -------------------------
129 #        start_point =  3 : BBTK
130 #-------------------------
131 if [ $start_point -le 3 ]
132 then
133 # the following stupid test is used at debug time; Please don't remove!
134 #if [ true = false ]
135 if [ true = true ]
136 then
137 # BBTK
138 echo ========================================================= $bbtksource $generationdir $installPrefix $buildType
139  bash $scriptDir/cmakemod.sh               $bbtksource $generationdir $installPrefix $buildType
140  bash $scriptDir/bbtkVariables.sh          $bbtksource $generationdir $docgeneration $gdcmVersion
141  bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber
142  bash $scriptDir/ctestmod.sh               $bbtksource $generationdir
143 fi
144 fi
145
146 bbtkdll=$generationdir/creatools_bin/bbtkBin
147 if [ $OperatingSystem = "MacOS" ]
148 then
149 #duplicate form creaTools_name.sh?? //FCY
150     DYLD_LIBRARY_PATH=$bbtkdll:$DYLD_LIBRARY_PATH
151 else
152     LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
153 fi
154 export BBTK_DIR=$generationdir/creatools_bin/bbtkBin
155
156 # -------------------------
157 #        start_point =  4 : creaMaracasVisu
158 #-------------------------
159 if [ $start_point -le 4 ]
160 then
161 # the following stupid test is used at debug time; Please don't remove!
162 #if [ true = false ]
163 if [ true = true ]
164 then
165 # creaMaracasVisu
166  bash $scriptDir/cmakemod.sh              $creamaracassource $generationdir $installPrefix $buildType 
167  bash $scriptDir/creaMaracasVariables.sh  $creamaracassource $generationdir $docgeneration
168  bash $scriptDir/compilemod.sh $buildType $creamaracassource $generationdir $corenumber
169  bash $scriptDir/ctestmod.sh              $creamaracassource $generationdir
170 fi
171 fi
172  creamaracasdll=$generationdir/creatools_bin/creaMaracasVisuBin
173
174 if [ $OperatingSystem = "MacOS" ]
175 then
176 #duplicate form creaTools_name.sh?? //FCY
177     DYLD_LIBRARY_PATH=$creamaracasdll:$DYLD_LIBRARY_$PATH 
178 else
179     LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_$PATH
180 fi 
181  
182  export creaMaracasVisu_DIR=$generationdir/creatools_bin/creaMaracasVisuBin
183
184 # -------------------------
185 #        start_point =  5 : creaEnvironment
186 #-------------------------
187 if [ $start_point -le 5 ]
188 then
189 # the following stupid test is used at debug time; Please don't remove!
190 #if [ true = false ]
191 if [ true = true ]
192 then
193 # creaEnvironment
194  bash $scriptDir/cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
195  bash $scriptDir/creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
196  bash $scriptDir/compilemod.sh    $buildType $creaenvironmentsource $generationdir $corenumber 
197  bash $scriptDir/ctestmod.sh                 $creaenvironmentsource $generationdir
198 fi
199 fi
200  creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
201  
202 if [ $OperatingSystem = "MacOS" ]
203 then
204 #duplicate form creaTools_name.sh?? //FCY
205     DYLD_LIBRARY_PATH=$creaenvironmentdll:$DYLD_LIBRARY_$PATH 
206 else
207     LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_$PATH
208 fi
209
210  export creaEnvironment_DIR=$generationdir/creatools_bin/creaEnvironmentBin
211
212 # -------------------------
213 #        start_point =  6 : creaBruker
214 #-------------------------
215 if [ $start_point -le 6 ]
216 then
217 # the following stupid test is used at debug time; Please don't remove!
218 #if [ true = false ]
219 if [ true = true ]
220 then
221 # creaBruker
222  bash $scriptDir/cmakemod.sh              $creabrukersource $generationdir $installPrefix $buildType 
223  bash $scriptDir/creaBrukerVariables.sh   $creabrukersource $generationdir $docgeneration $gdcmVersion
224  bash $scriptDir/compilemod.sh $buildType $creabrukersource $generationdir $corenumber
225  bash $scriptDir/ctestmod.sh              $creabrukersource $generationdir
226 fi
227 fi
228  creabrukerdll=$generationdir/creatools_bin/creabrukerBin
229  
230 if [ $OperatingSystem = "MacOS" ]
231 then
232 #duplicate form creaTools_name.sh?? //FCY
233     DYLD_LIBRARY_PATH=$creabrukerdll:$DYLD_LIBRARY_$PATH 
234 else
235     LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_$PATH
236 fi 
237  
238  export creaBruker_DIR=$generationdir/creatools_bin/creaBrukerBin
239
240 # -------------------------
241 #        start_point =  7 : creaImageIO
242 #-------------------------
243 if [ $start_point -le 7 ]
244 then
245  # the following stupid test is used at debug time; Please don't remove!
246 #if [ true = false ]
247 if [ true = true ]
248 then
249 # creaImageIO
250  bash $scriptDir/cmakemod.sh              $creaimagesource $generationdir $installPrefix $buildType 
251  bash $scriptDir/creaImageIOVariables.sh  $creaimagesource $generationdir $docgeneration $gdcmVersion
252  bash $scriptDir/compilemod.sh $buildType $creaimagesource $generationdir $corenumber
253  bash $scriptDir/ctestmod.sh              $creaimagesource $generationdir
254 fi
255 fi
256  creaimagedll=$generationdir/creatools_bin/creaimageBin
257  
258 if [ $OperatingSystem = "MacOS" ]
259 then
260 #duplicate form creaTools_name.sh?? //FCY
261     DYLD_LIBRARY_PATH=$creaimagedll:$DYLD_LIBRARY_$PATH 
262 else
263     LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_$PATH
264 fi
265
266 export creaImageIO_DIR=$generationdir/creatools_bin/creaImageIOBin
267
268 # -------------------------
269 #        start_point =  8 : creaContour
270 #-------------------------
271 if [ $start_point -le 8 ]
272 then
273 # the following stupid test is used at debug time; Please don't remove!
274 #if [ true = false ]
275 if [ true = true ]
276 then
277 # creaContours
278  bash $scriptDir/cmakemod.sh              $creacontourssource $generationdir $installPrefix $buildType 
279  bash $scriptDir/creaContoursVariables.sh $creacontourssource $generationdir $docgeneration
280  bash $scriptDir/compilemod.sh $buildType $creacontourssource $generationdir $corenumber
281  bash $scriptDir/ctestmod.sh              $creacontourssource $generationdir
282 fi
283 fi
284  creacontourdll=$generationdir/creatools_bin/creacontoursBin
285  
286 if [ $OperatingSystem = "MacOS" ]
287 then
288 #duplicate form creaTools_name.sh?? //FCY
289     DYLD_LIBRARY_PATH=$creacontoursdll:$DYLD_LIBRARY_$PATH 
290 else
291     LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_$PATH
292 fi
293
294  export creaContours_DIR=$generationdir/creatools_bin/creaContoursBin
295
296 # -------------------------
297 #        start_point =  9 : creaRigidRegistration
298 #-------------------------
299 if [ $start_point -le 9 ]
300 then
301 # the following stupid test is used at debug time; Please don't remove!
302 #if [ true = false ]
303 if [ true = true ]
304 then
305  bash $scriptDir/cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
306  bash $scriptDir/creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration
307  bash $scriptDir/compilemod.sh            $buildType $crearigidregistrationssource $generationdir $corenumber
308  bash $scriptDir/ctestmod.sh                         $crearigidregistrationssource $generationdir
309 fi
310 fi
311 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
312 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
313
314
315 # -------------------------
316 #        start_point =  10 : bbtkGEditor
317 #-------------------------
318 if [ $start_point -le 10 ]
319 then
320 # the following stupid test is used at debug time; Please don't remove!
321 #if [ true = false ]
322 if [ true = true ]
323 then
324 # bbtkGEditor
325  bash $scriptDir/cmakemod.sh              $bbtkgeditorsource $generationdir $installPrefix $buildType 
326  bash $scriptDir/bbtkGEditorVariables.sh  $bbtkgeditorsource $generationdir $docgeneration
327  bash $scriptDir/compilemod.sh $buildType $bbtkgeditorsource $generationdir $corenumber
328  bash $scriptDir/ctestmod.sh              $bbtkgeditorsource $generationdir
329 fi
330 fi
331 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
332 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
333
334
335
336
337 # -------------------------
338 #        start_point =  11 : libido
339 #-------------------------
340 #if [ $start_point -le 11 ]
341 #then
342 ## the following stupid test is used at debug time; Please don't remove!
343 ##if [ true = false ]
344 #if [ true = true ]
345 #then
346 ## creaTools
347 # bash $scriptDir/cmakemod.sh                $libidosource $generationdir $installPrefix $buildType 
348 # bash $scriptDir/libidoVariables.sh         $libidosource $generationdir $docgeneration
349 # bash $scriptDir/compilemod.sh   $buildType $libidosource $generationdir $corenumber
350 #fi
351 #fi
352
353
354
355 # -------------------------
356 #        start_point =  12 : creaTools
357 #-------------------------
358 if [ $start_point -le 12 ]
359 then
360 # the following stupid test is used at debug time; Please don't remove!
361 #if [ true = false ]
362 if [ true = true ]
363 then
364 # creaTools
365  bash $scriptDir/cmakemod.sh                $creatoolssource $generationdir $installPrefix $buildType 
366  bash $scriptDir/creaToolsVariables.sh      $creatoolssource $generationdir $docgeneration
367  bash $scriptDir/compilemod.sh   $buildType $creatoolssource $generationdir $corenumber
368 fi
369 fi
370
371
372 # bash ctestmod.sh $creatoolsbinary $generationdir
373 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
374 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
375
376
377 # -------------------------
378 #        start_point =  13 : creaMiniTools
379 #-------------------------
380 if [ $start_point -le 13 ]
381 then
382 # the following stupid test is used at debug time; Please don't remove!
383 #if [ true = false ]
384 if [ true = true ]
385 then
386 # creaMiniTools
387  bash $scriptDir/cmakemod.sh                   $creaminitoolssource $generationdir $installPrefix $buildType 
388  bash $scriptDir/creaMiniToolsVariables.sh     $creaminitoolssource $generationdir $docgeneration
389  bash $scriptDir/compilemod.sh      $buildType $creaminitoolssource $generationdir $corenumber
390 fi
391 fi
392
393
394 # shutdown /s
395 # exit /b