]> Creatis software - creaToolsTools.git/blob - Install/scripts/All.sh
8fffc7fe3bf7e263eaab92b5c12a9acd0188c6a6
[creaToolsTools.git] / Install / scripts / All.sh
1 #!/bin/sh
2
3 if [ $# = 0 ]
4 then
5 echo "Use it as :"
6 echo "sh All.sh <nameOfTheGenerationDirectory> <BooleanForDocGeneration> <userNameForCVS> <installPrefix> <buildType>"
7 echo "with 'installPrefix' : /usr/local or <directory where you want to generate>/creatools_install"
8 echo " "
9 echo "ex : sh All.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug"
10 exit 0
11 fi
12
13 echo $#
14 echo "----------"
15 echo $0
16 echo $1
17 echo $2
18 echo $3
19 echo $4
20 echo $5
21 echo "----------"
22
23 if [ $# != 5 ]
24 then 
25 echo "sh All.sh <nameOfTheGenerationDirectory> <BooleanForDocGeneration> <userNameForCVS> <installPrefix> <buildType>"
26 echo "with 'installPrefix' : /usr/local or <directory where you want to generate>/creatools_install"
27 echo " "
28 echo "ex : sh All.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug"
29 exit 0
30 fi
31
32 # @echo off
33
34 #allow user to choose the generation dir
35 #allow user to choose to generate the doc or not
36
37 generationdir=$1
38 cvsUserName=$3
39 installPrefix=$4
40 buildType=$5
41
42 scriptDir=$PWD
43 echo scriptDir
44 echo $scriptDir
45
46 mkdir $generationdir
47 mkdir $generationdir/creatools_source
48 mkdir $generationdir/creatools_bin
49
50  creasource=crea
51  bbtksource=bbtk
52  creamaracassource=creaMaracasVisu
53  creaenvironmentsource=creaEnvironment
54  creabrukersource=creaBruker
55  creaimagesource=creaImageIO
56  creacontourssource=creaContours
57  crearigidregistrationssource=creaRigidRegistration
58  bbtkgeditorsource=bbtkGEditor
59  creatoolssource=creaTools
60  
61 cd $generationdir
62
63 # start_point : used at debug time : start point of the script
64 # ex : if everything is OK, but bbtkGEditor, 
65 # cvs upate bbtkGEditor manually,and use :
66 # start_point=10
67 # in order not to cvs co everything, nor recompile everything.
68
69 start_point=0
70
71
72
73 # ----------------------------------
74 #         start_point =  0 : checkout all
75 #-----------------------------------
76 if [ $start_point -le 0 ]
77 then
78 #if [ true = false ]
79 if [ true = true ]
80 then
81   sh $scriptDir/cvscheckout.sh $creasource                   $generationdir $cvsUserName
82   sh $scriptDir/cvscheckout.sh $bbtksource                   $generationdir $cvsUserName
83   sh $scriptDir/cvscheckout.sh $creamaracassource            $generationdir $cvsUserName
84   sh $scriptDir/cvscheckout.sh $creaenvironmentsource        $generationdir $cvsUserName
85   sh $scriptDir/cvscheckout.sh $creabrukersource             $generationdir $cvsUserName
86   sh $scriptDir/cvscheckout.sh $creaimagesource              $generationdir $cvsUserName
87   sh $scriptDir/cvscheckout.sh $creacontourssource           $generationdir $cvsUserName
88   sh $scriptDir/cvscheckout.sh $crearigidregistrationssource $generationdir $cvsUserName
89   sh $scriptDir/cvscheckout.sh $bbtkgeditorsource            $generationdir $cvsUserName
90   sh $scriptDir/cvscheckout.sh $creatoolssource              $generationdir $cvsUserName
91 fi
92 fi
93
94
95 # --------------------------------
96 #         start_point = 1 : remove everything but source files
97 #---------------------------------
98 if [ $start_point -le 1 ]
99 then
100 # the following stupid test is used at debug time; Please don't remove!
101 #if [ true = false ]
102 if [ true = true ]
103 then
104   sudo rm -rf creatools_bin
105   mkdir $generationdir/creatools_bin
106   sudo rm -rf creatools_source
107   mkdir $generationdir/creatools_source
108
109   sudo rm -rf creatools_install/lib/creatools
110   sudo rm -rf creatools_install/lib64/creatools
111   sudo rm -rf creatools_install/bin/bb*
112   sudo rm -rf creatools_install/bin/crea*
113   sudo rm -rf creatools_install/include/bb*
114   sudo rm -rf creatools_install/include/crea*
115   sudo rm -rf creatools_install/share/bb*
116   sudo rm -rf creatools_install/share/crea*
117
118 #this is for the old versions EED
119   sudo rm -rf creatools_install/lib/crea*
120   sudo rm -rf creatools_install/lib/libbb*
121   sudo rm -rf creatools_install/lib/libcrea*
122   sudo rm -rf creatools_install/lib64/crea*
123   sudo rm -rf creatools_install/lib64/libbb*
124   sudo rm -rf creatools_install/lib64/libcrea*
125 fi
126 fi
127
128
129 # ----------------------------------
130 #         start_point =  1 : checkout all
131 #-----------------------------------
132 if [ $start_point -le 1 ]
133 then
134 #if [ true = false ]
135 if [ true = true ]
136 then
137   sh $scriptDir/cvscheckout.sh $creasource                   $generationdir $cvsUserName
138   sh $scriptDir/cvscheckout.sh $bbtksource                   $generationdir $cvsUserName
139   sh $scriptDir/cvscheckout.sh $creamaracassource            $generationdir $cvsUserName
140   sh $scriptDir/cvscheckout.sh $creaenvironmentsource        $generationdir $cvsUserName
141   sh $scriptDir/cvscheckout.sh $creabrukersource             $generationdir $cvsUserName
142   sh $scriptDir/cvscheckout.sh $creaimagesource              $generationdir $cvsUserName
143   sh $scriptDir/cvscheckout.sh $creacontourssource           $generationdir $cvsUserName
144   sh $scriptDir/cvscheckout.sh $crearigidregistrationssource $generationdir $cvsUserName
145   sh $scriptDir/cvscheckout.sh $bbtkgeditorsource            $generationdir $cvsUserName
146   sh $scriptDir/cvscheckout.sh $creatoolssource              $generationdir $cvsUserName
147 fi
148 fi
149
150 cd $scriptDir
151
152
153 # -------------------------
154 #        start_point =  2 : CREA
155 #-------------------------
156 if [ $start_point -le 2 ]
157 then
158 # CREA
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  sh cmakemod.sh         $creasource $generationdir $installPrefix $buildType 
164  sh creaVariables.sh    $creasource $generationdir $docgeneration
165  sh compilemod.sh       $buildType   $creasource $generationdir  
166  sh ctestmod.sh         $creasource $generationdir
167 fi
168 fi
169  creadll=$generationdir/creatools_bin/creaBin
170  LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH
171  
172
173
174 # -------------------------
175 #        start_point =  3 : BBTK
176 #-------------------------
177 if [ $start_point -le 3 ]
178 then
179 # the following stupid test is used at debug time; Please don't remove!
180 #if [ true = false ]
181 if [ true = true ]
182 then
183 # BBTK
184  sh cmakemod.sh         $bbtksource $generationdir $installPrefix $buildType 
185  sh bbtkVariables.sh    $bbtksource $generationdir $docgeneration
186  sh compilemod.sh       $buildType $bbtksource $generationdir 
187  sh ctestmod.sh         $bbtksource $generationdir
188 fi
189 fi
190  bbtkdll=$generationdir/creatools_bin/bbtkBin
191  LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
192
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  sh cmakemod.sh                 $creamaracassource $generationdir $installPrefix $buildType 
205  sh creaMaracasVariables.sh     $creamaracassource $generationdir $docgeneration
206  sh compilemod.sh               $buildType $creamaracassource $generationdir 
207  sh ctestmod.sh                 $creamaracassource $generationdir
208 fi
209 fi
210  creamaracasdll=$generationdir/creatools_bin/creamaracasBin
211  LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_PATH
212
213
214 # -------------------------
215 #        start_point =  5 : creaEnvironment
216 #-------------------------
217 if [ $start_point -le 5 ]
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 # creaEnvironment
224  sh cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
225  sh creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
226  sh compilemod.sh $buildType    $creaenvironmentsource $generationdir
227  sh ctestmod.sh                 $creaenvironmentsource $generationdir
228 fi
229 fi
230  creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
231  LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_PATH
232
233
234 # -------------------------
235 #        start_point =  6 : creaBruker
236 #-------------------------
237 if [ $start_point -le 6 ]
238 then
239 # the following stupid test is used at debug time; Please don't remove!
240 #if [ true = false ]
241 if [ true = true ]
242 then
243 # creaBruker
244  sh cmakemod.sh                 $creabrukersource $generationdir $installPrefix $buildType 
245  sh creaBrukerVariables.sh      $creabrukersource $generationdir $docgeneration
246  sh compilemod.sh $buildType    $creabrukersource  $generationdir
247  echo generationdir 
248  sh ctestmod.sh                 $creabrukersource $generationdir
249 fi
250 fi
251  creabrukerdll=$generationdir/creatools_bin/creabrukerBin
252  LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_PATH
253
254
255 # -------------------------
256 #        start_point =  7 : creaImageIO
257 #-------------------------
258 if [ $start_point -le 7 ]
259 then
260  # the following stupid test is used at debug time; Please don't remove!
261 #if [ true = false ]
262 if [ true = true ]
263 then
264 # creaImageIO
265  sh cmakemod.sh                 $creaimagesource $generationdir $installPrefix $buildType 
266  sh creaImageIOVariables.sh     $creaimagesource $generationdir $docgeneration
267  sh compilemod.sh               $buildType $creaimagesource $generationdir
268  sh ctestmod.sh                 $creaimagesource $generationdir
269 fi
270 fi
271  creaimagedll=$generationdir/creatools_bin/creaimageBin
272  LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_PATH
273
274
275 # -------------------------
276 #        start_point =  8 : creaContour
277 #-------------------------
278 if [ $start_point -le 8 ]
279 then
280 # the following stupid test is used at debug time; Please don't remove!
281 #if [ true = false ]
282 if [ true = true ]
283 then
284 # creaContours
285  sh cmakemod.sh                 $creacontourssource $generationdir $installPrefix $buildType 
286  sh creaContoursVariables.sh    $creacontourssource $generationdir $docgeneration
287  sh compilemod.sh               $buildType $creacontourssource $generationdir
288  sh ctestmod.sh                 $creacontourssource $generationdir
289 fi
290 fi
291 # creacontourdll=$generationdir/creatools_bin/creacontoursBin
292 # LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_PATH
293
294
295 # -------------------------
296 #        start_point =  9 : creaRigidRegistration
297 #-------------------------
298 if [ $start_point -le 9 ]
299 then
300 # the following stupid test is used at debug time; Please don't remove!
301 #if [ true = false ]
302 if [ true = true ]
303 then
304  sh cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
305  sh creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration
306  sh compilemod.sh                       $buildType $crearigidregistrationssource $generationdir
307  sh ctestmod.sh                         $crearigidregistrationssource $generationdir
308 fi
309 fi
310 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
311 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
312
313
314 # -------------------------
315 #        start_point =  10 : bbtkGEditor
316 #-------------------------
317 if [ $start_point -le 10 ]
318 then
319 # the following stupid test is used at debug time; Please don't remove!
320 #if [ true = false ]
321 if [ true = true ]
322 then
323 # bbtkGEditor
324  sh cmakemod.sh                 $bbtkgeditorsource $generationdir $installPrefix $buildType 
325  sh bbtkGEditorVariables.sh     $bbtkgeditorsource $generationdir $docgeneration
326  sh compilemod.sh               $buildType $bbtkgeditorsource $generationdir
327  sh ctestmod.sh                 $bbtkgeditorsource $generationdir
328 fi
329 fi
330 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
331 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
332
333
334 # -------------------------
335 #        start_point =  11 : creaTools
336 #-------------------------
337 if [ $start_point -le 11 ]
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 # creaTools
344  sh cmakemod.sh                    $creatoolssource $generationdir $installPrefix $buildType 
345  sh creaToolsVariables.sh          $creatoolssource $generationdir $docgeneration
346  sh compilemod.sh                  $buildType $creatoolssource $generationdir
347 fi
348 fi
349
350
351 # sh ctestmod.sh $creatoolsbinary $generationdir
352 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
353 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
354
355
356 CREATOOLS_INSTALL_DIR=$installPrefix
357 sudo rm        $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
358 sudo touch     $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
359 sudo chmod 666 $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
360
361 #######################################
362
363 sudo touch     $installPrefix/share/creatools_base_library_config.sh
364 sudo chmod 666 $installPrefix/share/creatools_base_library_config.sh
365
366
367 sudo echo export PATH='$'PATH:$installPrefix/bin                                  >> $installPrefix/share/creatools_base_library_config.sh
368 sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib/creatools >> $installPrefix/share/creatools_base_library_config.sh
369 sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib64/creatools >> $installPrefix/share/creatools_base_library_config.sh
370
371 #  modify .bashrc
372 # - remove line 'sh $installPrefix/creatools_install/share/creatools_base_party_libraries_config.sh' if any (with accurate value for ???)
373 sed -i -e '/.*creatools_base_library_config.*/ d' ~/.bashrc
374
375 # - add line 'sh $installPrefix/creatools_install/share/creatools_base_libraries_config.sh' (with accurate value for ???)
376 echo source $installPrefix/share/creatools_base_library_config.sh >> ~/.bashrc 
377
378
379 # shutdown /s
380 # exit /b