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