]> Creatis software - creaToolsTools.git/blob - Install/scripts/All.sh
*** empty log message ***
[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 echo scriptDir
48 echo $scriptDir
49
50
51 mkdir $generationdir
52 cd $generationdir
53
54  creasource=crea
55  bbtksource=bbtk
56  creamaracassource=creaMaracasVisu
57  creaenvironmentsource=creaEnvironment
58  creabrukersource=creaBruker
59  creaimagesource=creaImageIO
60  creacontourssource=creaContours
61  crearigidregistrationssource=creaRigidRegistration
62  bbtkgeditorsource=bbtkGEditor
63  creatoolssource=creaTools
64
65
66 # start_point : used at debug time : start point of the script
67 # ex : if everything is OK, but bbtkGEditor, 
68 # cvs upate bbtkGEditor manually,and use :
69 # start_point=10
70 # in order not to cvs co everything, nor recompile everything.
71
72 start_point=0
73
74
75
76 # --------------------------------
77 #         start_point = 0 : remove everything but source files
78 #---------------------------------
79 if [ $start_point -le 0 ]
80 then
81 # the following stupid test is used at debug time; Please don't remove!
82 #if [ true = false ]
83 if [ true = true ]
84 then
85   rm -rf creatools_bin
86   mkdir $generationdir/creatools_bin
87   rm -rf creatools_source
88   mkdir $generationdir/creatools_source
89
90   sudo rm -rf creatools_install/lib/creatools
91   sudo rm -rf creatools_install/lib64/creatools
92   sudo rm -rf creatools_install/bin/bb*
93   sudo rm -rf creatools_install/bin/crea*
94   sudo rm -rf creatools_install/include/bb*
95   sudo rm -rf creatools_install/include/crea*
96   sudo rm -rf creatools_install/share/bb*
97   sudo rm -rf creatools_install/share/crea*
98
99 #this is for the old versions EED
100   sudo rm -rf creatools_install/lib/crea*
101   sudo rm -rf creatools_install/lib/libbb*
102   sudo rm -rf creatools_install/lib/libcrea*
103   sudo rm -rf creatools_install/lib64/crea*
104   sudo rm -rf creatools_install/lib64/libbb*
105   sudo rm -rf creatools_install/lib64/libcrea*
106 fi
107 fi
108
109
110 # ----------------------------------
111 #         start_point =  1 : checkout all
112 #-----------------------------------
113 if [ $start_point -le 1 ]
114 then
115 #if [ true = false ]
116 if [ true = true ]
117 then
118   sh $scriptDir/cvscheckout.sh $creasource                   $generationdir $cvsUserName
119   sh $scriptDir/cvscheckout.sh $bbtksource                   $generationdir $cvsUserName
120   sh $scriptDir/cvscheckout.sh $creamaracassource            $generationdir $cvsUserName
121   sh $scriptDir/cvscheckout.sh $creaenvironmentsource        $generationdir $cvsUserName
122   sh $scriptDir/cvscheckout.sh $creabrukersource             $generationdir $cvsUserName
123   sh $scriptDir/cvscheckout.sh $creaimagesource              $generationdir $cvsUserName
124   sh $scriptDir/cvscheckout.sh $creacontourssource           $generationdir $cvsUserName
125   sh $scriptDir/cvscheckout.sh $crearigidregistrationssource $generationdir $cvsUserName
126   sh $scriptDir/cvscheckout.sh $bbtkgeditorsource            $generationdir $cvsUserName
127   sh $scriptDir/cvscheckout.sh $creatoolssource              $generationdir $cvsUserName
128 fi
129 fi
130
131 cd $scriptDir
132
133
134 # -------------------------
135 #        start_point =  2 : CREA
136 #-------------------------
137 if [ $start_point -le 2 ]
138 then
139 # CREA
140 # the following stupid test is used at debug time; Please don't remove!
141 #if [ true = false ]
142 if [ true = true ]
143 then
144  sh cmakemod.sh         $creasource $generationdir $installPrefix $buildType 
145  sh creaVariables.sh    $creasource $generationdir $docgeneration
146  sh compilemod.sh       $buildType   $creasource $generationdir  
147  sh ctestmod.sh         $creasource $generationdir
148 fi
149 fi
150  creadll=$generationdir/creatools_bin/creaBin
151  LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH
152
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  sh cmakemod.sh         $bbtksource $generationdir $installPrefix $buildType 
165  sh bbtkVariables.sh    $bbtksource $generationdir $docgeneration $gdcmVersion
166  sh compilemod.sh       $buildType $bbtksource $generationdir 
167  sh ctestmod.sh         $bbtksource $generationdir
168 fi
169 fi
170  bbtkdll=$generationdir/creatools_bin/bbtkBin
171  LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
172
173
174 # -------------------------
175 #        start_point =  4 : creaMaracasVisu
176 #-------------------------
177 if [ $start_point -le 4 ]
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 # creaMaracasVisu
184  sh cmakemod.sh                 $creamaracassource $generationdir $installPrefix $buildType 
185  sh creaMaracasVariables.sh     $creamaracassource $generationdir $docgeneration
186  sh compilemod.sh               $buildType $creamaracassource $generationdir 
187  sh ctestmod.sh                 $creamaracassource $generationdir
188 fi
189 fi
190  creamaracasdll=$generationdir/creatools_bin/creamaracasBin
191  LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_PATH
192
193
194 # -------------------------
195 #        start_point =  5 : creaEnvironment
196 #-------------------------
197 if [ $start_point -le 5 ]
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 # creaEnvironment
204  sh cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
205  sh creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
206  sh compilemod.sh $buildType    $creaenvironmentsource $generationdir
207  sh ctestmod.sh                 $creaenvironmentsource $generationdir
208 fi
209 fi
210  creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
211  LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_PATH
212
213
214 # -------------------------
215 #        start_point =  6 : creaBruker
216 #-------------------------
217 if [ $start_point -le 6 ]
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 # creaBruker
224  sh cmakemod.sh              $creabrukersource $generationdir $installPrefix $buildType 
225  sh creaBrukerVariables.sh       $creabrukersource $generationdir $docgeneration $gdcmVersion
226  sh compilemod.sh $buildType $creabrukersource $generationdir
227  echo generationdir 
228  sh ctestmod.sh              $creabrukersource $generationdir
229 fi
230 fi
231  creabrukerdll=$generationdir/creatools_bin/creabrukerBin
232  LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_PATH
233
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  sh cmakemod.sh                 $creaimagesource $generationdir $installPrefix $buildType 
246  sh creaImageIOVariables.sh     $creaimagesource $generationdir $docgeneration $gdcmVersion
247  sh compilemod.sh    $buildType $creaimagesource $generationdir
248  sh ctestmod.sh                 $creaimagesource $generationdir
249 fi
250 fi
251  creaimagedll=$generationdir/creatools_bin/creaimageBin
252  LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_PATH
253
254
255 # -------------------------
256 #        start_point =  8 : creaContour
257 #-------------------------
258 if [ $start_point -le 8 ]
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 # creaContours
265  sh cmakemod.sh                 $creacontourssource $generationdir $installPrefix $buildType 
266  sh creaContoursVariables.sh    $creacontourssource $generationdir $docgeneration
267  sh compilemod.sh        $buildType $creacontourssource $generationdir
268  sh ctestmod.sh                 $creacontourssource $generationdir
269 fi
270 fi
271 # creacontourdll=$generationdir/creatools_bin/creacontoursBin
272 # LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_PATH
273
274
275 # -------------------------
276 #        start_point =  9 : creaRigidRegistration
277 #-------------------------
278 if [ $start_point -le 9 ]
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  sh cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
285  sh creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration
286  sh compilemod.sh                        $buildType $crearigidregistrationssource $generationdir
287  sh ctestmod.sh                         $crearigidregistrationssource $generationdir
288 fi
289 fi
290 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
291 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
292
293
294 # -------------------------
295 #        start_point =  10 : bbtkGEditor
296 #-------------------------
297 if [ $start_point -le 10 ]
298 then
299 # the following stupid test is used at debug time; Please don't remove!
300 #if [ true = false ]
301 if [ true = true ]
302 then
303 # bbtkGEditor
304  sh cmakemod.sh                 $bbtkgeditorsource $generationdir $installPrefix $buildType 
305  sh bbtkGEditorVariables.sh     $bbtkgeditorsource $generationdir $docgeneration
306  sh compilemod.sh    $buildType $bbtkgeditorsource $generationdir
307  sh ctestmod.sh                 $bbtkgeditorsource $generationdir
308 fi
309 fi
310 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
311 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
312
313
314 # -------------------------
315 #        start_point =  11 : creaTools
316 #-------------------------
317 if [ $start_point -le 11 ]
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 # creaTools
324  sh cmakemod.sh                    $creatoolssource $generationdir $installPrefix $buildType 
325  sh creaToolsVariables.sh          $creatoolssource $generationdir $docgeneration
326  sh compilemod.sh               $buildType $creatoolssource $generationdir
327 fi
328 fi
329
330
331 # sh ctestmod.sh $creatoolsbinary $generationdir
332 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
333 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
334
335
336 CREATOOLS_INSTALL_DIR=$installPrefix
337 sudo rm        $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
338 sudo touch     $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
339 sudo chmod 666 $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
340
341 #######################################
342
343 sudo touch     $installPrefix/share/creatools_base_library_config.sh
344 sudo chmod 666 $installPrefix/share/creatools_base_library_config.sh
345
346
347 sudo echo export PATH='$'PATH:$installPrefix/bin                                   >> $installPrefix/share/creatools_base_library_config.sh
348 sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib/creatools   >> $installPrefix/share/creatools_base_library_config.sh
349 sudo echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib64/creatools >> $installPrefix/share/creatools_base_library_config.sh
350
351 #  modify .bashrc
352 # - remove line 'sh $installPrefix/creatools_install/share/creatools_base_party_libraries_config.sh' if any (with accurate value for ???)
353 sed -i -e '/.*installPrefixCreaTools*/ d' ~/.bashrc
354 sed -i -e '/.*creatools_base_library_config.*/ d' ~/.bashrc
355
356 # - add line 'sh $installPrefix/creatools_install/share/creatools_base_libraries_config.sh' (with accurate value for ???)
357 echo installPrefixCreaTools=$installPrefix >> ~/.bashrc
358 echo '[ -f "$installPrefixCreaTools/share/creatools_base_library_config.sh" ] &&  source $installPrefixCreaTools/share/creatools_base_library_config.sh' >> ~/.bashrc 
359
360
361 # shutdown /s
362 # exit /b