]> Creatis software - creaToolsTools.git/blob - Install/scripts/All.sh
Choose source loading mode : from CVS / HTML
[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> <GDCM Version>"
7 echo "with 'installPrefix' : /usr/local or <directory where you want to generate>/creatools_install"
8 echo "with 'GDCM Version' : GDCM1 / GDCM2"
9 echo " "
10 echo "ex : sh All.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug GDCM2"
11 exit 0
12 fi
13
14 echo $#
15 echo "----------"
16 echo $0
17 echo $1
18 echo $2
19 echo $3
20 echo $4
21 echo $5
22 echo $6
23 echo "----------"
24
25 if [ $# != 6 ]
26 then 
27 echo "sh All.sh <nameOfTheGenerationDirectory> <BooleanForDocGeneration> <userNameForCVS> <installPrefix> <buildType> <GDCM Version>"
28 echo "with 'installPrefix' : /usr/local or <directory where you want to generate>/creatools_install"
29 echo " "
30 echo "ex : sh All.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug GDCM2"
31 exit 0
32 fi
33
34 # @echo off
35
36 #allow user to choose the generation dir
37 #allow user to choose to generate the doc or not
38
39 generationdir=$1
40 docGeneration=$2
41 cvsUserName=$3
42 installPrefix=$4
43 buildType=$5
44 gdcmVersion=$6
45
46 scriptDir=$PWD
47
48  creasource=crea
49  bbtksource=bbtk
50  creamaracassource=creaMaracasVisu
51  creaenvironmentsource=creaEnvironment
52  creabrukersource=creaBruker
53  creaimagesource=creaImageIO
54  creacontourssource=creaContours
55  crearigidregistrationssource=creaRigidRegistration
56  bbtkgeditorsource=bbtkGEditor
57  creatoolssource=creaTools
58
59 mkdir $generationdir
60 mkdir $generationdir/creatools_source
61 mkdir $generationdir/creatools_bin
62  
63 cd $generationdir
64
65 # start_point : used at debug time : start point of the script
66 # ex : if everything is OK, but bbtkGEditor, 
67 # cvs upate bbtkGEditor manually,and use :
68 # start_point=10
69 # in order not to cvs co everything, nor recompile everything.
70
71 start_point=0
72
73
74
75 # ----------------------------------
76 #         start_point =  0 : checkout all
77 #-----------------------------------
78 if [ $start_point -le 0 ]
79 then
80 #if [ true = false ]
81 if [ true = true ]
82 then
83   sh $scriptDir/cvscheckout.sh $creasource                   $generationdir $cvsUserName
84   sh $scriptDir/cvscheckout.sh $bbtksource                   $generationdir $cvsUserName
85   sh $scriptDir/cvscheckout.sh $creamaracassource            $generationdir $cvsUserName
86   sh $scriptDir/cvscheckout.sh $creaenvironmentsource        $generationdir $cvsUserName
87   sh $scriptDir/cvscheckout.sh $creabrukersource             $generationdir $cvsUserName
88   sh $scriptDir/cvscheckout.sh $creaimagesource              $generationdir $cvsUserName
89   sh $scriptDir/cvscheckout.sh $creacontourssource           $generationdir $cvsUserName
90   sh $scriptDir/cvscheckout.sh $crearigidregistrationssource $generationdir $cvsUserName
91   sh $scriptDir/cvscheckout.sh $bbtkgeditorsource            $generationdir $cvsUserName
92   sh $scriptDir/cvscheckout.sh $creatoolssource              $generationdir $cvsUserName
93 fi
94 fi
95
96 # --------------------------------
97 #         start_point = 1 : remove everything but source files
98 #---------------------------------
99 if [ $start_point -le 1 ]
100 then
101 # the following stupid test is used at debug time; Please don't remove!
102 #if [ true = false ]
103 if [ true = true ]
104 then
105   rm -rf creatools_bin
106   mkdir $generationdir/creatools_bin
107   rm -rf creatools_source
108   mkdir $generationdir/creatools_source
109
110   sudo rm -rf creatools_install/lib/creatools
111   sudo rm -rf creatools_install/lib64/creatools
112   sudo rm -rf creatools_install/bin/bb*
113   sudo rm -rf creatools_install/bin/crea*
114   sudo rm -rf creatools_install/include/bb*
115   sudo rm -rf creatools_install/include/crea*
116   sudo rm -rf creatools_install/share/bb*
117   sudo rm -rf creatools_install/share/crea*
118
119 #this is for the old versions EED
120   sudo rm -rf creatools_install/lib/crea*
121   sudo rm -rf creatools_install/lib/libbb*
122   sudo rm -rf creatools_install/lib/libcrea*
123   sudo rm -rf creatools_install/lib64/crea*
124   sudo rm -rf creatools_install/lib64/libbb*
125   sudo rm -rf creatools_install/lib64/libcrea*
126 fi
127 fi
128
129
130 # ----------------------------------
131 #         start_point =  1 : checkout all
132 #-----------------------------------
133 if [ $start_point -le 1 ]
134 then
135 #if [ true = false ]
136 if [ true = true ]
137 then
138   sh $scriptDir/cvscheckout.sh $creasource                   $generationdir $cvsUserName
139   sh $scriptDir/cvscheckout.sh $bbtksource                   $generationdir $cvsUserName
140   sh $scriptDir/cvscheckout.sh $creamaracassource            $generationdir $cvsUserName
141   sh $scriptDir/cvscheckout.sh $creaenvironmentsource        $generationdir $cvsUserName
142   sh $scriptDir/cvscheckout.sh $creabrukersource             $generationdir $cvsUserName
143   sh $scriptDir/cvscheckout.sh $creaimagesource              $generationdir $cvsUserName
144   sh $scriptDir/cvscheckout.sh $creacontourssource           $generationdir $cvsUserName
145   sh $scriptDir/cvscheckout.sh $crearigidregistrationssource $generationdir $cvsUserName
146   sh $scriptDir/cvscheckout.sh $bbtkgeditorsource            $generationdir $cvsUserName
147   sh $scriptDir/cvscheckout.sh $creatoolssource              $generationdir $cvsUserName
148 fi
149 fi
150
151 cd $scriptDir
152
153
154 # -------------------------
155 #        start_point =  2 : CREA
156 #-------------------------
157 if [ $start_point -le 2 ]
158 then
159 # CREA
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  sh cmakemod.sh         $creasource $generationdir $installPrefix $buildType 
165  sh creaVariables.sh    $creasource $generationdir $docgeneration
166  sh compilemod.sh       $buildType   $creasource $generationdir  
167  sh ctestmod.sh         $creasource $generationdir
168 fi
169 fi
170  creadll=$generationdir/creatools_bin/creaBin
171  LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH
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 $gdcmVersion
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 $gdcmVersion
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 $gdcmVersion
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 [ -f "$installPrefix/share/creatools_base_library_config.sh" ] &&  source $installPrefix/share/creatools_base_library_config.sh >> ~/.bashrc 
377 echo source $installPrefix/share/creatools_base_library_config.sh >> ~/.bashrc 
378
379
380 # shutdown /s
381 # exit /b