]> Creatis software - creaToolsTools.git/blob - Linux/scripts/CreaTools-compile.sh
#3224 creaToolsTools Feature New Normal - vtk8itk4wx3-mingw64
[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       bash $scriptDir/cmakemod.sh                  $creasource $generationdir $installPrefix $buildType 
139       bash $scriptDir/creaVariables.sh             $creasource $generationdir $docgeneration
140       bash $scriptDir/compilemod.sh     $buildType $creasource $generationdir $corenumber
141       bash $scriptDir/ctestmod.sh                  $creasource $generationdir
142    fi
143 fi
144 creadll=$generationdir/creatools_bin/creaBin
145 if [ $OperatingSystem = "MacOS" ]
146 then
147     #duplicate form creaTools_name.sh?? //FCY
148     DYLD_LIBRARY_PATH=$creadll:$DYLD_LIBRARY_$PATH 
149 else
150     LD_LIBRARY_PATH=$creadll:$LD_LIBRARY_$PATH
151 fi
152  export crea_DIR=$generationdir/creatools_bin/creaBin
153
154 # -------------------------
155 #        start_point =  3 : BBTK
156 #-------------------------
157 if [ $start_point -le 3 ]
158 then
159    # the following stupid test is used at debug time; Please don't remove!
160    #if [ true = false ]
161    if [ true = true ]
162    then
163    # BBTK
164      echo ========================================================= $bbtksource $generationdir $installPrefix $buildType
165      bash $scriptDir/cmakemod.sh               $bbtksource $generationdir $installPrefix $buildType
166      bash $scriptDir/bbtkVariables.sh          $bbtksource $generationdir $docgeneration $gdcmVersion
167      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbtk
168      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbi
169      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbfy
170      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbStudio
171      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbPackageBrowser
172      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbs2cpp
173      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbRegenerateBoxesLists
174      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbRegeneratePackageDoc
175      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbPlugPackage
176      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbpConfigurator
177      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbvtk
178      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber bbwx
179      bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber 
180      bash $scriptDir/ctestmod.sh               $bbtksource $generationdir
181    fi
182 fi
183
184 bbtkdll=$generationdir/creatools_bin/bbtkBin
185 if [ $OperatingSystem = "MacOS" ]
186 then
187     #duplicate form creaTools_name.sh?? //FCY
188     DYLD_LIBRARY_PATH=$bbtkdll:$DYLD_LIBRARY_PATH
189 else
190     LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
191 fi
192 export BBTK_DIR=$generationdir/creatools_bin/bbtkBin
193
194 # -------------------------
195 #        start_point =  4 : creaMaracasVisu
196 #-------------------------
197 if [ $start_point -le 4 ]
198 then
199    # the following stupid test is used at debug time; Please don't remove!
200    #if [ true = false ]
201    if [ true = true ]
202    then
203       # creaMaracasVisu
204       bash $scriptDir/cmakemod.sh              $creamaracassource $generationdir $installPrefix $buildType 
205       bash $scriptDir/creaMaracasVariables.sh  $creamaracassource $generationdir $docgeneration
206       bash $scriptDir/compilemod.sh $buildType $creamaracassource $generationdir $corenumber
207       bash $scriptDir/ctestmod.sh              $creamaracassource $generationdir
208    fi
209 fi
210  creamaracasdll=$generationdir/creatools_bin/creaMaracasVisuBin
211
212 if [ $OperatingSystem = "MacOS" ]
213 then
214     #duplicate form creaTools_name.sh?? //FCY
215     DYLD_LIBRARY_PATH=$creamaracasdll:$DYLD_LIBRARY_$PATH
216 else
217     LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_$PATH
218 fi 
219  
220  export creaMaracasVisu_DIR=$generationdir/creatools_bin/creaMaracasVisuBin
221
222 # -------------------------
223 #        start_point =  5 : creaEnvironment
224 #-------------------------
225 if [ $start_point -le 5 ]
226 then
227    # the following stupid test is used at debug time; Please don't remove!
228    #if [ true = false ]
229    if [ true = true ]
230    then
231    # creaEnvironment
232       bash $scriptDir/cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
233       bash $scriptDir/creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
234       bash $scriptDir/compilemod.sh    $buildType $creaenvironmentsource $generationdir $corenumber 
235       bash $scriptDir/ctestmod.sh                 $creaenvironmentsource $generationdir
236    fi
237 fi
238 creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
239  
240 if [ $OperatingSystem = "MacOS" ]
241 then
242     #duplicate form creaTools_name.sh?? //FCY
243     DYLD_LIBRARY_PATH=$creaenvironmentdll:$DYLD_LIBRARY_$PATH 
244 else
245     LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_$PATH
246 fi
247
248  export creaEnvironment_DIR=$generationdir/creatools_bin/creaEnvironmentBin
249
250 # -------------------------
251 #        start_point =  6 : creaBruker
252 #-------------------------
253 if [ $start_point -le 6 ]
254 then
255    # the following stupid test is used at debug time; Please don't remove!
256    #if [ true = false ]
257    if [ true = true ]
258    then
259    # creaBruker
260       bash $scriptDir/cmakemod.sh              $creabrukersource $generationdir $installPrefix $buildType 
261       bash $scriptDir/creaBrukerVariables.sh   $creabrukersource $generationdir $docgeneration $gdcmVersion
262       bash $scriptDir/compilemod.sh $buildType $creabrukersource $generationdir $corenumber
263       bash $scriptDir/ctestmod.sh              $creabrukersource $generationdir
264    fi
265 fi
266 creabrukerdll=$generationdir/creatools_bin/creabrukerBin
267  
268 if [ $OperatingSystem = "MacOS" ]
269 then
270     #duplicate form creaTools_name.sh?? //FCY
271     DYLD_LIBRARY_PATH=$creabrukerdll:$DYLD_LIBRARY_$PATH 
272 else
273     LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_$PATH
274 fi 
275  
276  export creaBruker_DIR=$generationdir/creatools_bin/creaBrukerBin
277
278 # -------------------------
279 #        start_point =  7 : creaImageIO
280 #-------------------------
281 if [ $start_point -le 7 ]
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    # creaImageIO
288       bash $scriptDir/cmakemod.sh              $creaimagesource $generationdir $installPrefix $buildType 
289       bash $scriptDir/creaImageIOVariables.sh  $creaimagesource $generationdir $docgeneration $gdcmVersion
290       bash $scriptDir/compilemod.sh $buildType $creaimagesource $generationdir $corenumber
291       bash $scriptDir/ctestmod.sh              $creaimagesource $generationdir
292    fi
293 fi
294 creaimagedll=$generationdir/creatools_bin/creaimageBin
295  
296 if [ $OperatingSystem = "MacOS" ]
297 then
298     #duplicate form creaTools_name.sh?? //FCY
299     DYLD_LIBRARY_PATH=$creaimagedll:$DYLD_LIBRARY_$PATH 
300 else
301     LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_$PATH
302 fi
303
304 export creaImageIO_DIR=$generationdir/creatools_bin/creaImageIOBin
305
306 # -------------------------
307 #        start_point =  8 : creaContour
308 #-------------------------
309 if [ $start_point -le 8 ]
310 then
311    # the following stupid test is used at debug time; Please don't remove!
312    #if [ true = false ]
313    if [ true = true ]
314    then
315       # creaContours
316       bash $scriptDir/cmakemod.sh              $creacontourssource $generationdir $installPrefix $buildType 
317       bash $scriptDir/creaContoursVariables.sh $creacontourssource $generationdir $docgeneration
318       bash $scriptDir/compilemod.sh $buildType $creacontourssource $generationdir $corenumber
319       bash $scriptDir/ctestmod.sh              $creacontourssource $generationdir
320    fi
321 fi
322  creacontourdll=$generationdir/creatools_bin/creacontoursBin
323  
324 if [ $OperatingSystem = "MacOS" ]
325 then
326     #duplicate form creaTools_name.sh?? //FCY
327     DYLD_LIBRARY_PATH=$creacontoursdll:$DYLD_LIBRARY_$PATH 
328 else
329     LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_$PATH
330 fi
331
332  export creaContours_DIR=$generationdir/creatools_bin/creaContoursBin
333
334 # -------------------------
335 #        start_point =  9 : creaRigidRegistration
336 #-------------------------
337 if [ $start_point -le 9 ]
338 then
339    # the following stupid test is used at debug time; Please don't remove!
340    #if [ true = false ]
341    if [ true = true ]
342    then
343       bash $scriptDir/cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
344       bash $scriptDir/creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration
345       bash $scriptDir/compilemod.sh            $buildType $crearigidregistrationssource $generationdir $corenumber
346       bash $scriptDir/ctestmod.sh                         $crearigidregistrationssource $generationdir
347    fi
348 fi
349 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
350 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
351
352
353 # -------------------------
354 #        start_point =  10 : bbtkGEditor
355 #-------------------------
356 if [ $start_point -le 10 ]
357 then
358    # the following stupid test is used at debug time; Please don't remove!
359    #if [ true = false ]
360    if [ true = true ]
361    then
362       # bbtkGEditor
363       bash $scriptDir/cmakemod.sh              $bbtkgeditorsource $generationdir $installPrefix $buildType 
364       bash $scriptDir/bbtkGEditorVariables.sh  $bbtkgeditorsource $generationdir $docgeneration
365       bash $scriptDir/compilemod.sh $buildType $bbtkgeditorsource $generationdir $corenumber
366       bash $scriptDir/ctestmod.sh              $bbtkgeditorsource $generationdir
367    fi
368 fi
369 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
370 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
371
372
373 # -------------------------
374 #        start_point =  11 : libido
375 #-------------------------
376 #if [ $start_point -le 11 ]
377 #then
378    ## the following stupid test is used at debug time; Please don't remove!
379    ##if [ true = false ]
380    #if [ true = true ]
381    #then
382       ## creaTools
383       # bash $scriptDir/cmakemod.sh                $libidosource $generationdir $installPrefix $buildType 
384       # bash $scriptDir/libidoVariables.sh         $libidosource $generationdir $docgeneration
385       # bash $scriptDir/compilemod.sh   $buildType $libidosource $generationdir $corenumber
386    #fi
387 #fi
388
389
390
391 # -------------------------
392 #        start_point =  12 : creaTools
393 #-------------------------
394 if [ $start_point -le 12 ]
395 then
396    # the following stupid test is used at debug time; Please don't remove!
397    #if [ true = false ]
398    if [ true = true ]
399    then
400       # creaTools
401       bash $scriptDir/cmakemod.sh                $creatoolssource $generationdir $installPrefix $buildType 
402       bash $scriptDir/creaToolsVariables.sh      $creatoolssource $generationdir $docgeneration
403       bash $scriptDir/compilemod.sh   $buildType $creatoolssource $generationdir $corenumber
404    fi
405 fi
406
407
408 # bash ctestmod.sh $creatoolsbinary $generationdir
409 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
410 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
411
412
413 # -------------------------
414 #        start_point =  13 : creaMiniTools
415 #-------------------------
416 if [ $start_point -le 13 ]
417 then
418    # the following stupid test is used at debug time; Please don't remove!
419    #if [ true = false ]
420    if [ true = true ]
421    then
422       # creaMiniTools
423       bash $scriptDir/cmakemod.sh                   $creaminitoolssource $generationdir $installPrefix $buildType 
424       bash $scriptDir/creaMiniToolsVariables.sh     $creaminitoolssource $generationdir $docgeneration
425       bash $scriptDir/compilemod.sh      $buildType $creaminitoolssource $generationdir $corenumber
426    fi
427 fi
428
429
430 # -------------------------
431 #        start_point =  14 : creaVtk
432 #-------------------------
433 if [ $start_point -le 14 ]
434 then
435    # the following stupid test is used at debug time; Please don't remove!
436    #if [ true = false ]
437    if [ true = true ]
438    then
439       # creaVtk
440       bash $scriptDir/cmakemod.sh              $creavtksource $generationdir $installPrefix $buildType 
441       bash $scriptDir/creaVtkVariables.sh  $creavtksource $generationdir $docgeneration
442       bash $scriptDir/compilemod.sh $buildType $creavtksource $generationdir $corenumber
443       bash $scriptDir/ctestmod.sh              $creavtksource $generationdir
444    fi
445 fi
446  creavtkdll=$generationdir/creatools_bin/creaVtkBin
447
448 if [ $OperatingSystem = "MacOS" ]
449 then
450     #duplicate form creaTools_name.sh?? //FCY
451     DYLD_LIBRARY_PATH=$creavtkdll:$DYLD_LIBRARY_$PATH
452 else
453     LD_LIBRARY_PATH=$creavtkdll:$LD_LIBRARY_$PATH
454 fi 
455  
456  export creaVtk_DIR=$generationdir/creatools_bin/creaVtkBin
457
458
459
460
461 # shutdown /s
462 # exit /b