]> Creatis software - creaToolsTools.git/blob - Linux/scripts/CreaTools-compile.sh
#3405 creaToolsTools Feature New Normal - vtk8itk5wx3-macos
[creaToolsTools.git] / Linux / scripts / CreaTools-compile.sh
1 # ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
4 #                        pour la Santé)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 #
7 #  This software is governed by the CeCILL-B license under French law and 
8 #  abiding by the rules of distribution of free software. You can  use, 
9 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
10 #  license as circulated by CEA, CNRS and INRIA at the following URL 
11 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
12 #  or in the file LICENSE.txt.
13 #
14 #  As a counterpart to the access to the source code and  rights to copy,
15 #  modify and redistribute granted by the license, users are provided only
16 #  with a limited warranty  and the software's author,  the holder of the
17 #  economic rights,  and the successive licensors  have only  limited
18 #  liability. 
19 #
20 #  The fact that you are presently reading this means that you have had
21 #  knowledge of the CeCILL-B license and that you accept its terms.
22 # ------------------------------------------------------------------------  
23
24
25 #!/bin/bash
26
27 if [ ! -f $PWD/scripts/CreaTools-configure.sh ]
28 then 
29    echo
30    echo "..ERROR.."
31    echo "==================================================="
32    echo "REMEMBER !"
33    echo ""
34    echo "YOU NEED TO RUN 'Configure' (0) FIRST !"
35    echo "==================================================="
36    echo
37    echo
38    exit 0
39 fi
40
41 # Set all local variables
42  
43  source $PWD/scripts/CreaTools-configure.sh
44  source $PWD/scripts/CreaTools-names.sh
45
46    echo "------"
47    echo $PWD/scripts/CreaTools-configure.sh
48    echo --generationdir--
49    echo $generationdir
50    echo --corenumber--
51    echo $corenumber   
52    echo --docgeneration--
53    echo $docgeneration
54    echo --installPrefix--
55    echo $installPrefix
56    echo --installPrefixThird--
57    echo $installPrefixThird   
58    echo --buildType-- 
59    echo $buildType
60    echo --gdcmVersion--
61    echo $gdcmVersion
62    echo "--ETC_BASHRC--"
63    echo $ETC_BASHRC
64    echo --sourcesFrom--
65    echo $sourcesFrom
66    echo --scriptDir--
67    echo $scriptDir
68    echo --start_point--
69    echo $start_point
70    echo "------"
71
72 if [ ! -f $installPrefixThird/share/creatools/creatools_third_party_library_config.sh ]
73 then
74  echo missing  $installPrefixThird/share/creatools/creatools_third_party_library_config.sh
75    echo
76    echo "..ERROR.."
77    echo "==================================================="
78    echo "REMEMBER !"
79    echo ""
80    echo "YOU NEED TO RUN 'Install Third Party Libraries' (1) FIRST !"
81    echo "==================================================="
82    echo
83    echo "Hit any key to continue"
84    read a
85    exit 0
86 fi
87
88  if [ ! -e $generationdir/creatools_source ]
89  then 
90  echo missing  $generationdir/creatools_source
91    echo
92    echo "..ERROR.."
93    echo "==================================================="
94    echo "REMEMBER !"
95    echo ""
96    echo "YOU NEED TO RUN 'Load' (2) FIRST !"
97    echo "==================================================="
98    echo
99    echo
100    exit 0
101 fi
102
103
104 if [ ! -f $installPrefixThird/share/creatools/creatools_third_party_library_config.sh ]
105 then
106  echo missing  $installPrefixThird/share/creatools/creatools_third_party_library_config.sh
107    echo
108    echo "..ERROR.."
109    echo "==================================================="
110    echo "REMEMBER !"
111    echo ""
112    echo "YOU NEED TO RUN 'Load' (2) FIRST !"
113    echo "==================================================="
114    echo
115    echo
116    exit 0
117 fi
118
119  cd $generationdir
120  if [ -e creatools_bin ]
121  then
122     rm -rf creatools_bin
123  fi
124  mkdir -p creatools_bin
125
126 cd $scriptDir
127
128 # -------------------------
129 #        start_point =  2 : CREA
130 #-------------------------
131 if [ $start_point -le 2 ]
132 then
133 # CREA
134 # the following stupid test is used at debug time; Please don't remove!
135 #if [ true = false ]
136    if [ true = true ]
137    then
138
139       bash $scriptDir/cmakemod.sh                  $creasource $generationdir $installPrefix $buildType 
140       bash $scriptDir/creaVariables.sh             $creasource $generationdir $docgeneration
141       bash $scriptDir/compilemod.sh     $buildType $creasource $generationdir $corenumber
142       bash $scriptDir/ctestmod.sh                  $creasource $generationdir
143    fi
144 fi
145 creadll=$generationdir/creatools_bin/creaBin
146 if [ $OperatingSystem = "MacOS" ]
147 then
148     #duplicate form creaTools_name.sh?? //FCY
149     DYLD_LIBRARY_PATH=$creadll:$DYLD_LIBRARY_$PATH 
150 else
151     LD_LIBRARY_PATH=$creadll:$LD_LIBRARY_$PATH
152 fi
153  export crea_DIR=$generationdir/creatools_bin/creaBin
154
155 # -------------------------
156 #        start_point =  3 : BBTK
157 #-------------------------
158 if [ $start_point -le 3 ]
159 then
160    # the following stupid test is used at debug time; Please don't remove!
161    #if [ true = false ]
162    if [ true = true ]
163    then
164    # BBTK
165      echo ========================================================= $bbtksource $generationdir $installPrefix $buildType
166      bash $scriptDir/cmakemod.sh               $bbtksource $generationdir $installPrefix $buildType
167      bash $scriptDir/bbtkVariables.sh          $bbtksource $generationdir $docgeneration $gdcmVersion
168      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbtk
169      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbi
170      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbfy
171      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbStudio
172      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbPackageBrowser
173      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbs2cpp
174      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbRegenerateBoxesLists
175      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbRegeneratePackageDoc
176      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbPlugPackage
177      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbpConfigurator
178      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbvtk
179      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbwx
180      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber 
181      bash $scriptDir/ctestmod.sh               $bbtksource $generationdir
182    fi
183 fi
184
185 bbtkdll=$generationdir/creatools_bin/bbtkBin
186 if [ $OperatingSystem = "MacOS" ]
187 then
188     #duplicate form creaTools_name.sh?? //FCY
189     DYLD_LIBRARY_PATH=$bbtkdll:$DYLD_LIBRARY_PATH
190 else
191     LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
192 fi
193 export BBTK_DIR=$generationdir/creatools_bin/bbtkBin
194
195 # -------------------------
196 #        start_point =  4 : creaMaracasVisu
197 #-------------------------
198 if [ $start_point -le 4 ]
199 then
200    # the following stupid test is used at debug time; Please don't remove!
201    #if [ true = false ]
202    if [ true = true ]
203    then
204       # creaMaracasVisu
205       bash $scriptDir/cmakemod.sh              $creamaracassource $generationdir $installPrefix $buildType 
206       bash $scriptDir/creaMaracasVariables.sh  $creamaracassource $generationdir $docgeneration
207       bash $scriptDir/compilemod.sh $buildType $creamaracassource $generationdir $corenumber
208       bash $scriptDir/ctestmod.sh              $creamaracassource $generationdir
209    fi
210 fi
211  creamaracasdll=$generationdir/creatools_bin/creaMaracasVisuBin
212
213 if [ $OperatingSystem = "MacOS" ]
214 then
215     #duplicate form creaTools_name.sh?? //FCY
216     DYLD_LIBRARY_PATH=$creamaracasdll:$DYLD_LIBRARY_$PATH
217 else
218     LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_$PATH
219 fi 
220  
221  export creaMaracasVisu_DIR=$generationdir/creatools_bin/creaMaracasVisuBin
222
223 # -------------------------
224 #        start_point =  5 : creaEnvironment
225 #-------------------------
226 if [ $start_point -le 5 ]
227 then
228    # the following stupid test is used at debug time; Please don't remove!
229    #if [ true = false ]
230    if [ true = true ]
231    then
232    # creaEnvironment
233       bash $scriptDir/cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
234       bash $scriptDir/creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
235       bash $scriptDir/compilemod.sh    $buildType $creaenvironmentsource $generationdir $corenumber 
236       bash $scriptDir/ctestmod.sh                 $creaenvironmentsource $generationdir
237    fi
238 fi
239 creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
240  
241 if [ $OperatingSystem = "MacOS" ]
242 then
243     #duplicate form creaTools_name.sh?? //FCY
244     DYLD_LIBRARY_PATH=$creaenvironmentdll:$DYLD_LIBRARY_$PATH 
245 else
246     LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_$PATH
247 fi
248
249  export creaEnvironment_DIR=$generationdir/creatools_bin/creaEnvironmentBin
250
251 # -------------------------
252 #        start_point =  6 : creaBruker
253 #-------------------------
254 if [ $start_point -le 6 ]
255 then
256    # the following stupid test is used at debug time; Please don't remove!
257    #if [ true = false ]
258    if [ true = true ]
259    then
260    # creaBruker
261       bash $scriptDir/cmakemod.sh              $creabrukersource $generationdir $installPrefix $buildType 
262       bash $scriptDir/creaBrukerVariables.sh   $creabrukersource $generationdir $docgeneration $gdcmVersion
263       bash $scriptDir/compilemod.sh $buildType $creabrukersource $generationdir $corenumber
264       bash $scriptDir/ctestmod.sh              $creabrukersource $generationdir
265    fi
266 fi
267 creabrukerdll=$generationdir/creatools_bin/creabrukerBin
268  
269 if [ $OperatingSystem = "MacOS" ]
270 then
271     #duplicate form creaTools_name.sh?? //FCY
272     DYLD_LIBRARY_PATH=$creabrukerdll:$DYLD_LIBRARY_$PATH 
273 else
274     LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_$PATH
275 fi 
276  
277  export creaBruker_DIR=$generationdir/creatools_bin/creaBrukerBin
278
279 # -------------------------
280 #        start_point =  7 : creaImageIO
281 #-------------------------
282 if [ $start_point -le 7 ]
283 then
284    # the following stupid test is used at debug time; Please don't remove!
285    #if [ true = false ]
286    if [ true = true ]
287    then
288    # creaImageIO
289       bash $scriptDir/cmakemod.sh              $creaimagesource $generationdir $installPrefix $buildType 
290       bash $scriptDir/creaImageIOVariables.sh  $creaimagesource $generationdir $docgeneration $gdcmVersion
291       bash $scriptDir/compilemod.sh $buildType $creaimagesource $generationdir $corenumber
292       bash $scriptDir/ctestmod.sh              $creaimagesource $generationdir
293    fi
294 fi
295 creaimagedll=$generationdir/creatools_bin/creaimageBin
296  
297 if [ $OperatingSystem = "MacOS" ]
298 then
299     #duplicate form creaTools_name.sh?? //FCY
300     DYLD_LIBRARY_PATH=$creaimagedll:$DYLD_LIBRARY_$PATH 
301 else
302     LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_$PATH
303 fi
304
305 export creaImageIO_DIR=$generationdir/creatools_bin/creaImageIOBin
306
307 # -------------------------
308 #        start_point =  8 : creaContour
309 #-------------------------
310 if [ $start_point -le 8 ]
311 then
312    # the following stupid test is used at debug time; Please don't remove!
313    #if [ true = false ]
314    if [ true = true ]
315    then
316       # creaContours
317       bash $scriptDir/cmakemod.sh              $creacontourssource $generationdir $installPrefix $buildType 
318       bash $scriptDir/creaContoursVariables.sh $creacontourssource $generationdir $docgeneration
319       bash $scriptDir/compilemod.sh $buildType $creacontourssource $generationdir $corenumber
320       bash $scriptDir/ctestmod.sh              $creacontourssource $generationdir
321    fi
322 fi
323  creacontourdll=$generationdir/creatools_bin/creacontoursBin
324  
325 if [ $OperatingSystem = "MacOS" ]
326 then
327     #duplicate form creaTools_name.sh?? //FCY
328     DYLD_LIBRARY_PATH=$creacontoursdll:$DYLD_LIBRARY_$PATH 
329 else
330     LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_$PATH
331 fi
332
333  export creaContours_DIR=$generationdir/creatools_bin/creaContoursBin
334
335 # -------------------------
336 #        start_point =  9 : creaRigidRegistration
337 #-------------------------
338 if [ $start_point -le 9 ]
339 then
340    # the following stupid test is used at debug time; Please don't remove!
341    #if [ true = false ]
342    if [ true = true ]
343    then
344       bash $scriptDir/cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
345       bash $scriptDir/creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration
346       bash $scriptDir/compilemod.sh            $buildType $crearigidregistrationssource $generationdir $corenumber
347       bash $scriptDir/ctestmod.sh                         $crearigidregistrationssource $generationdir
348    fi
349 fi
350 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
351 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
352
353
354 # -------------------------
355 #        start_point =  10 : bbtkGEditor
356 #-------------------------
357 if [ $start_point -le 10 ]
358 then
359    # the following stupid test is used at debug time; Please don't remove!
360    #if [ true = false ]
361    if [ true = true ]
362    then
363       # bbtkGEditor
364       bash $scriptDir/cmakemod.sh              $bbtkgeditorsource $generationdir $installPrefix $buildType 
365       bash $scriptDir/bbtkGEditorVariables.sh  $bbtkgeditorsource $generationdir $docgeneration
366       bash $scriptDir/compilemod.sh $buildType $bbtkgeditorsource $generationdir $corenumber
367       bash $scriptDir/ctestmod.sh              $bbtkgeditorsource $generationdir
368    fi
369 fi
370 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
371 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
372
373
374 # -------------------------
375 #        start_point =  11 : libido
376 #-------------------------
377 #if [ $start_point -le 11 ]
378 #then
379    ## the following stupid test is used at debug time; Please don't remove!
380    ##if [ true = false ]
381    #if [ true = true ]
382    #then
383       ## creaTools
384       # bash $scriptDir/cmakemod.sh                $libidosource $generationdir $installPrefix $buildType 
385       # bash $scriptDir/libidoVariables.sh         $libidosource $generationdir $docgeneration
386       # bash $scriptDir/compilemod.sh   $buildType $libidosource $generationdir $corenumber
387    #fi
388 #fi
389
390
391
392 # -------------------------
393 #        start_point =  12 : creaTools
394 #-------------------------
395 if [ $start_point -le 12 ]
396 then
397    # the following stupid test is used at debug time; Please don't remove!
398    #if [ true = false ]
399    if [ true = true ]
400    then
401       # creaTools
402       bash $scriptDir/cmakemod.sh                $creatoolssource $generationdir $installPrefix $buildType 
403       bash $scriptDir/creaToolsVariables.sh      $creatoolssource $generationdir $docgeneration
404       bash $scriptDir/compilemod.sh   $buildType $creatoolssource $generationdir $corenumber
405    fi
406 fi
407
408
409 # bash ctestmod.sh $creatoolsbinary $generationdir
410 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
411 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
412
413
414 # -------------------------
415 #        start_point =  13 : creaMiniTools
416 #-------------------------
417 if [ $start_point -le 13 ]
418 then
419    # the following stupid test is used at debug time; Please don't remove!
420    #if [ true = false ]
421    if [ true = true ]
422    then
423       # creaMiniTools
424       bash $scriptDir/cmakemod.sh                   $creaminitoolssource $generationdir $installPrefix $buildType 
425       bash $scriptDir/creaMiniToolsVariables.sh     $creaminitoolssource $generationdir $docgeneration
426       bash $scriptDir/compilemod.sh      $buildType $creaminitoolssource $generationdir $corenumber
427    fi
428 fi
429
430
431 # -------------------------
432 #        start_point =  14 : creaVtk
433 #-------------------------
434 if [ $start_point -le 14 ]
435 then
436    # the following stupid test is used at debug time; Please don't remove!
437    #if [ true = false ]
438    if [ true = true ]
439    then
440       # creaVtk
441       bash $scriptDir/cmakemod.sh              $creavtksource $generationdir $installPrefix $buildType 
442       bash $scriptDir/creaVtkVariables.sh  $creavtksource $generationdir $docgeneration
443       bash $scriptDir/compilemod.sh $buildType $creavtksource $generationdir $corenumber
444       bash $scriptDir/ctestmod.sh              $creavtksource $generationdir
445    fi
446 fi
447  creavtkdll=$generationdir/creatools_bin/creaVtkBin
448
449 if [ $OperatingSystem = "MacOS" ]
450 then
451     #duplicate form creaTools_name.sh?? //FCY
452     DYLD_LIBRARY_PATH=$creavtkdll:$DYLD_LIBRARY_$PATH
453 else
454     LD_LIBRARY_PATH=$creavtkdll:$LD_LIBRARY_$PATH
455 fi 
456  
457  export creaVtk_DIR=$generationdir/creatools_bin/creaVtkBin
458
459
460
461
462 # shutdown /s
463 # exit /b