]> Creatis software - creaToolsTools.git/blob - Linux/scripts/CreaTools-compile.sh
Try to solve MacOS issues
[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     DYLD_LIBRARY_PATH=$creadll:DYLD_LIBRARY_$PATH 
122  else
123     LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH
124  fi
125  export crea_DIR=$generationdir/creatools_bin/creaBin
126
127 # -------------------------
128 #        start_point =  3 : BBTK
129 #-------------------------
130 if [ $start_point -le 3 ]
131 then
132 # the following stupid test is used at debug time; Please don't remove!
133 #if [ true = false ]
134 if [ true = true ]
135 then
136 # BBTK
137 echo ========================================================= $bbtksource $generationdir $installPrefix $buildType
138  bash $scriptDir/cmakemod.sh               $bbtksource $generationdir $installPrefix $buildType
139  bash $scriptDir/bbtkVariables.sh          $bbtksource $generationdir $docgeneration $gdcmVersion
140  bash $scriptDir/compilemod.sh  $buildType $bbtksource $generationdir $corenumber
141  bash $scriptDir/ctestmod.sh               $bbtksource $generationdir
142 fi
143 fi
144
145 bbtkdll=$generationdir/creatools_bin/bbtkBin
146 if [ $OperatingSystem = "MacOS" ]
147 then
148     DYLD_LIBRARY_PATH=$bbtkdll:$DYLD_LIBRARY_PATH
149 else
150     LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
151 fi
152 export BBTK_DIR=$generationdir/creatools_bin/bbtkBin
153
154 # -------------------------
155 #        start_point =  4 : creaMaracasVisu
156 #-------------------------
157 if [ $start_point -le 4 ]
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 # creaMaracasVisu
164  bash $scriptDir/cmakemod.sh              $creamaracassource $generationdir $installPrefix $buildType 
165  bash $scriptDir/creaMaracasVariables.sh  $creamaracassource $generationdir $docgeneration
166  bash $scriptDir/compilemod.sh $buildType $creamaracassource $generationdir $corenumber
167  bash $scriptDir/ctestmod.sh              $creamaracassource $generationdir
168 fi
169 fi
170  creamaracasdll=$generationdir/creatools_bin/creaMaracasVisuBin
171
172 if [ $OperatingSystem = "MacOS" ]
173 then
174     DYLD_LIBRARY_PATH=$creamaracasdll:DYLD_LIBRARY_$PATH 
175 else
176     LD_LIBRARY_PATH=$creamaracasdll:LD_LIBRARY_$PATH
177 fi 
178  
179  export creaMaracasVisu_DIR=$generationdir/creatools_bin/creaMaracasVisuBin
180
181 # -------------------------
182 #        start_point =  5 : creaEnvironment
183 #-------------------------
184 if [ $start_point -le 5 ]
185 then
186 # the following stupid test is used at debug time; Please don't remove!
187 #if [ true = false ]
188 if [ true = true ]
189 then
190 # creaEnvironment
191  bash $scriptDir/cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
192  bash $scriptDir/creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
193  bash $scriptDir/compilemod.sh    $buildType $creaenvironmentsource $generationdir $corenumber 
194  bash $scriptDir/ctestmod.sh                 $creaenvironmentsource $generationdir
195 fi
196 fi
197  creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
198  
199 if [ $OperatingSystem = "MacOS" ]
200 then
201     DYLD_LIBRARY_PATH=$creaenvironmentdll:DYLD_LIBRARY_$PATH 
202 else
203     LD_LIBRARY_PATH=$creaenvironmentdll:LD_LIBRARY_$PATH
204 fi
205
206  export creaEnvironment_DIR=$generationdir/creatools_bin/creaEnvironmentBin
207
208 # -------------------------
209 #        start_point =  6 : creaBruker
210 #-------------------------
211 if [ $start_point -le 6 ]
212 then
213 # the following stupid test is used at debug time; Please don't remove!
214 #if [ true = false ]
215 if [ true = true ]
216 then
217 # creaBruker
218  bash $scriptDir/cmakemod.sh              $creabrukersource $generationdir $installPrefix $buildType 
219  bash $scriptDir/creaBrukerVariables.sh   $creabrukersource $generationdir $docgeneration $gdcmVersion
220  bash $scriptDir/compilemod.sh $buildType $creabrukersource $generationdir $corenumber
221  bash $scriptDir/ctestmod.sh              $creabrukersource $generationdir
222 fi
223 fi
224  creabrukerdll=$generationdir/creatools_bin/creabrukerBin
225  
226 if [ $OperatingSystem = "MacOS" ]
227 then
228     DYLD_LIBRARY_PATH=$creabrukerdll:DYLD_LIBRARY_$PATH 
229 else
230     LD_LIBRARY_PATH=$creabrukerdll:LD_LIBRARY_$PATH
231 fi 
232  
233  export creaBruker_DIR=$generationdir/creatools_bin/creaBrukerBin
234
235 # -------------------------
236 #        start_point =  7 : creaImageIO
237 #-------------------------
238 if [ $start_point -le 7 ]
239 then
240  # the following stupid test is used at debug time; Please don't remove!
241 #if [ true = false ]
242 if [ true = true ]
243 then
244 # creaImageIO
245  bash $scriptDir/cmakemod.sh              $creaimagesource $generationdir $installPrefix $buildType 
246  bash $scriptDir/creaImageIOVariables.sh  $creaimagesource $generationdir $docgeneration $gdcmVersion
247  bash $scriptDir/compilemod.sh $buildType $creaimagesource $generationdir $corenumber
248  bash $scriptDir/ctestmod.sh              $creaimagesource $generationdir
249 fi
250 fi
251  creaimagedll=$generationdir/creatools_bin/creaimageBin
252  
253 if [ $OperatingSystem = "MacOS" ]
254 then
255     DYLD_LIBRARY_PATH=$creaimagedll:DYLD_LIBRARY_$PATH 
256 else
257     LD_LIBRARY_PATH=$creaimagedll:LD_LIBRARY_$PATH
258 fi
259
260 export creaImageIO_DIR=$generationdir/creatools_bin/creaImageIOBin
261
262 # -------------------------
263 #        start_point =  8 : creaContour
264 #-------------------------
265 if [ $start_point -le 8 ]
266 then
267 # the following stupid test is used at debug time; Please don't remove!
268 #if [ true = false ]
269 if [ true = true ]
270 then
271 # creaContours
272  bash $scriptDir/cmakemod.sh              $creacontourssource $generationdir $installPrefix $buildType 
273  bash $scriptDir/creaContoursVariables.sh $creacontourssource $generationdir $docgeneration
274  bash $scriptDir/compilemod.sh $buildType $creacontourssource $generationdir $corenumber
275  bash $scriptDir/ctestmod.sh              $creacontourssource $generationdir
276 fi
277 fi
278  creacontourdll=$generationdir/creatools_bin/creacontoursBin
279  
280 if [ $OperatingSystem = "MacOS" ]
281 then
282     DYLD_LIBRARY_PATH=$creacontoursdll:DYLD_LIBRARY_$PATH 
283 else
284     LD_LIBRARY_PATH=$creacontoursdll:LD_LIBRARY_$PATH
285 fi
286
287  export creaContours_DIR=$generationdir/creatools_bin/creaContoursBin
288
289 # -------------------------
290 #        start_point =  9 : creaRigidRegistration
291 #-------------------------
292 if [ $start_point -le 9 ]
293 then
294 # the following stupid test is used at debug time; Please don't remove!
295 #if [ true = false ]
296 if [ true = true ]
297 then
298  bash $scriptDir/cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
299  bash $scriptDir/creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration
300  bash $scriptDir/compilemod.sh            $buildType $crearigidregistrationssource $generationdir $corenumber
301  bash $scriptDir/ctestmod.sh                         $crearigidregistrationssource $generationdir
302 fi
303 fi
304 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
305 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
306
307
308 # -------------------------
309 #        start_point =  10 : bbtkGEditor
310 #-------------------------
311 if [ $start_point -le 10 ]
312 then
313 # the following stupid test is used at debug time; Please don't remove!
314 #if [ true = false ]
315 if [ true = true ]
316 then
317 # bbtkGEditor
318  bash $scriptDir/cmakemod.sh              $bbtkgeditorsource $generationdir $installPrefix $buildType 
319  bash $scriptDir/bbtkGEditorVariables.sh  $bbtkgeditorsource $generationdir $docgeneration
320  bash $scriptDir/compilemod.sh $buildType $bbtkgeditorsource $generationdir $corenumber
321  bash $scriptDir/ctestmod.sh              $bbtkgeditorsource $generationdir
322 fi
323 fi
324 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
325 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
326
327
328
329
330 # -------------------------
331 #        start_point =  11 : libido
332 #-------------------------
333 #if [ $start_point -le 11 ]
334 #then
335 ## the following stupid test is used at debug time; Please don't remove!
336 ##if [ true = false ]
337 #if [ true = true ]
338 #then
339 ## creaTools
340 # bash $scriptDir/cmakemod.sh                $libidosource $generationdir $installPrefix $buildType 
341 # bash $scriptDir/libidoVariables.sh         $libidosource $generationdir $docgeneration
342 # bash $scriptDir/compilemod.sh   $buildType $libidosource $generationdir $corenumber
343 #fi
344 #fi
345
346
347
348 # -------------------------
349 #        start_point =  12 : creaTools
350 #-------------------------
351 if [ $start_point -le 12 ]
352 then
353 # the following stupid test is used at debug time; Please don't remove!
354 #if [ true = false ]
355 if [ true = true ]
356 then
357 # creaTools
358  bash $scriptDir/cmakemod.sh                $creatoolssource $generationdir $installPrefix $buildType 
359  bash $scriptDir/creaToolsVariables.sh      $creatoolssource $generationdir $docgeneration
360  bash $scriptDir/compilemod.sh   $buildType $creatoolssource $generationdir $corenumber
361 fi
362 fi
363
364
365 # bash ctestmod.sh $creatoolsbinary $generationdir
366 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
367 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
368
369
370 # -------------------------
371 #        start_point =  13 : creaMiniTools
372 #-------------------------
373 if [ $start_point -le 13 ]
374 then
375 # the following stupid test is used at debug time; Please don't remove!
376 #if [ true = false ]
377 if [ true = true ]
378 then
379 # creaMiniTools
380  bash $scriptDir/cmakemod.sh                   $creaminitoolssource $generationdir $installPrefix $buildType 
381  bash $scriptDir/creaMiniToolsVariables.sh     $creaminitoolssource $generationdir $docgeneration
382  bash $scriptDir/compilemod.sh      $buildType $creaminitoolssource $generationdir $corenumber
383 fi
384 fi
385
386
387 # shutdown /s
388 # exit /b