]> Creatis software - creaToolsTools.git/blob - Install/scripts/All.sh
56a8554cc9bd2733fd5311cb5778a9c224e1532b
[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/creaBin
105   sudo rm -rf creatools_bin/bbtkBin
106   sudo rm -rf creatools_bin/creaMaracasVisuBin
107   sudo rm -rf creatools_bin/creaEnvironmentBin
108   sudo rm -rf creatools_bin/creaBrukerBin
109   sudo rm -rf creatools_bin/creaImageIOBin
110   sudo rm -rf creatools_bin/creaContoursBin
111   sudo rm -rf creatools_bin/creaRigidRegistrationBin
112   sudo rm -rf creatools_bin/bbtkGEditorBin
113   sudo rm -rf creatools_bin/creaToolsBin
114
115   sudo rm -rf creatools_install/lib/creatools
116   sudo rm -rf creatools_install/lib64/creatools
117   sudo rm -rf creatools_install/bin/bb*
118   sudo rm -rf creatools_install/bin/crea*
119   sudo rm -rf creatools_install/include/bb*
120   sudo rm -rf creatools_install/include/crea*
121   sudo rm -rf creatools_install/share/bb*
122   sudo rm -rf creatools_install/share/crea*
123
124 #this is for the old versions EED
125   sudo rm -rf creatools_install/lib/crea*
126   sudo rm -rf creatools_install/lib/libbb*
127   sudo rm -rf creatools_install/lib/libcrea*
128   sudo rm -rf creatools_install/lib64/crea*
129   sudo rm -rf creatools_install/lib64/libbb*
130   sudo rm -rf creatools_install/lib64/libcrea*
131 fi
132 fi
133
134 cd $scriptDir
135
136
137 # -------------------------
138 #        start_point =  2 : CREA
139 #-------------------------
140 if [ $start_point -le 2 ]
141 then
142 # CREA
143 # the following stupid test is used at debug time; Please don't remove!
144 #if [ true = false ]
145 if [ true = true ]
146 then
147  sh cmakemod.sh         $creasource $generationdir $installPrefix $buildType 
148  sh creaVariables.sh    $creasource $generationdir $docgeneration
149  sh compilemod.sh       $buildType   $creasource $generationdir  
150  sh ctestmod.sh         $creasource $generationdir
151 fi
152 fi
153  creadll=$generationdir/creatools_bin/creaBin
154  LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH
155  
156
157
158 # -------------------------
159 #        start_point =  3 : BBTK
160 #-------------------------
161 if [ $start_point -le 3 ]
162 then
163 # the following stupid test is used at debug time; Please don't remove!
164 #if [ true = false ]
165 if [ true = true ]
166 then
167 # BBTK
168  sh cmakemod.sh         $bbtksource $generationdir $installPrefix $buildType 
169  sh bbtkVariables.sh    $bbtksource $generationdir $docgeneration
170  sh compilemod.sh       $buildType $bbtksource $generationdir 
171  sh ctestmod.sh         $bbtksource $generationdir
172 fi
173 fi
174  bbtkdll=$generationdir/creatools_bin/bbtkBin
175  LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
176
177
178 # -------------------------
179 #        start_point =  4 : creaMaracasVisu
180 #-------------------------
181 if [ $start_point -le 4 ]
182 then
183 # the following stupid test is used at debug time; Please don't remove!
184 #if [ true = false ]
185 if [ true = true ]
186 then
187 # creaMaracasVisu
188  sh cmakemod.sh                 $creamaracassource $generationdir $installPrefix $buildType 
189  sh creaMaracasVariables.sh     $creamaracassource $generationdir $docgeneration
190  sh compilemod.sh               $buildType $creamaracassource $generationdir 
191  sh ctestmod.sh                 $creamaracassource $generationdir
192 fi
193 fi
194  creamaracasdll=$generationdir/creatools_bin/creamaracasBin
195  LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_PATH
196
197
198 # -------------------------
199 #        start_point =  5 : creaEnvironment
200 #-------------------------
201 if [ $start_point -le 5 ]
202 then
203 # the following stupid test is used at debug time; Please don't remove!
204 #if [ true = false ]
205 if [ true = true ]
206 then
207 # creaEnvironment
208  sh cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
209  sh creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
210  sh compilemod.sh $buildType    $creaenvironmentsource $generationdir
211  sh ctestmod.sh                 $creaenvironmentsource $generationdir
212 fi
213 fi
214  creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
215  LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_PATH
216
217
218 # -------------------------
219 #        start_point =  6 : creaBruker
220 #-------------------------
221 if [ $start_point -le 6 ]
222 then
223 # the following stupid test is used at debug time; Please don't remove!
224 #if [ true = false ]
225 if [ true = true ]
226 then
227 # creaBruker
228  sh cmakemod.sh                 $creabrukersource $generationdir $installPrefix $buildType 
229  sh creaBrukerVariables.sh      $creabrukersource $generationdir $docgeneration
230  sh compilemod.sh $buildType    $creabrukersource  $generationdir
231  echo generationdir 
232  sh ctestmod.sh                 $creabrukersource $generationdir
233 fi
234 fi
235  creabrukerdll=$generationdir/creatools_bin/creabrukerBin
236  LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_PATH
237
238
239 # -------------------------
240 #        start_point =  7 : creaImageIO
241 #-------------------------
242 if [ $start_point -le 7 ]
243 then
244  # the following stupid test is used at debug time; Please don't remove!
245 #if [ true = false ]
246 if [ true = true ]
247 then
248 # creaImageIO
249  sh cmakemod.sh                 $creaimagesource $generationdir $installPrefix $buildType 
250  sh creaImageIOVariables.sh     $creaimagesource $generationdir $docgeneration
251  sh compilemod.sh               $buildType $creaimagesource $generationdir
252  sh ctestmod.sh                 $creaimagesource $generationdir
253 fi
254 fi
255  creaimagedll=$generationdir/creatools_bin/creaimageBin
256  LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_PATH
257
258
259 # -------------------------
260 #        start_point =  8 : creaContour
261 #-------------------------
262 if [ $start_point -le 8 ]
263 then
264 # the following stupid test is used at debug time; Please don't remove!
265 #if [ true = false ]
266 if [ true = true ]
267 then
268 # creaContours
269  sh cmakemod.sh                 $creacontourssource $generationdir $installPrefix $buildType 
270  sh creaContoursVariables.sh    $creacontourssource $generationdir $docgeneration
271  sh compilemod.sh               $buildType $creacontourssource $generationdir
272  sh ctestmod.sh                 $creacontourssource $generationdir
273 fi
274 fi
275 # creacontourdll=$generationdir/creatools_bin/creacontoursBin
276 # LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_PATH
277
278
279 # -------------------------
280 #        start_point =  9 : creaRigidRegistration
281 #-------------------------
282 if [ $start_point -le 9 ]
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  sh cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
289  sh creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration
290  sh compilemod.sh                       $buildType $crearigidregistrationssource $generationdir
291  sh ctestmod.sh                         $crearigidregistrationssource $generationdir
292 fi
293 fi
294 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
295 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
296
297
298 # -------------------------
299 #        start_point =  10 : bbtkGEditor
300 #-------------------------
301 if [ $start_point -le 10 ]
302 then
303 # the following stupid test is used at debug time; Please don't remove!
304 #if [ true = false ]
305 if [ true = true ]
306 then
307 # bbtkGEditor
308  sh cmakemod.sh                 $bbtkgeditorsource $generationdir $installPrefix $buildType 
309  sh bbtkGEditorVariables.sh     $bbtkgeditorsource $generationdir $docgeneration
310  sh compilemod.sh               $buildType $bbtkgeditorsource $generationdir
311  sh ctestmod.sh                 $bbtkgeditorsource $generationdir
312 fi
313 fi
314 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
315 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
316
317
318 # -------------------------
319 #        start_point =  11 : creaTools
320 #-------------------------
321 if [ $start_point -le 11 ]
322 then
323 # the following stupid test is used at debug time; Please don't remove!
324 #if [ true = false ]
325 if [ true = true ]
326 then
327 # creaTools
328  sh cmakemod.sh                    $creatoolssource $generationdir $installPrefix $buildType 
329  sh creaToolsVariables.sh          $creatoolssource $generationdir $docgeneration
330  sh compilemod.sh                  $buildType $creatoolssource $generationdir
331 fi
332 fi
333
334
335 # sh ctestmod.sh $creatoolsbinary $generationdir
336 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
337 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
338
339
340 CREATOOLS_INSTALL_DIR=$installPrefix
341 sudo rm        $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
342 sudo touch     $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
343 sudo chmod 666 $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
344
345 #######################################
346
347 sudo touch     $installPrefix/share/creatools_base_library_config.sh
348 sudo chmod 666 $installPrefix/share/creatools_base_library_config.sh
349
350
351 sudo echo export PATH='$'PATH:$installPrefix/bin                                  >> $installPrefix/share/creatools_base_library_config.sh
352 sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib/creatools >> $installPrefix/share/creatools_base_library_config.sh
353 sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib64/creatools >> $installPrefix/share/creatools_base_library_config.sh
354
355 #  modify .bashrc
356 # - remove line 'sh $installPrefix/creatools_install/share/creatools_base_party_libraries_config.sh' if any (with accurate value for ???)
357 sed -i -e '/.*creatools_base_library_config.*/ d' ~/.bashrc
358
359 # - add line 'sh $installPrefix/creatools_install/share/creatools_base_libraries_config.sh' (with accurate value for ???)
360 echo source $installPrefix/share/creatools_base_library_config.sh >> ~/.bashrc 
361
362
363 # shutdown /s
364 # exit /b