]> Creatis software - creaToolsTools.git/blob - Install/scripts/All.sh
Automatic generation of 'export' of environment variables in .bashrc
[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 # the following stupid test is used at debug time; Please don't remove!
64 #if [ true = false ]
65 if [ true = true ]
66 then
67   sudo rm -rf creatools_bin/creaBin
68   sudo rm -rf creatools_bin/bbtkBin
69   sudo rm -rf creatools_bin/creaMaracasVisuBin
70   sudo rm -rf creatools_bin/creaEnvironmentBin
71   sudo rm -rf creatools_bin/creaBrukerBin
72   sudo rm -rf creatools_bin/creaImageIOBin
73   sudo rm -rf creatools_bin/creaContoursBin
74   sudo rm -rf creatools_bin/creaRigidRegistrationBin
75   sudo rm -rf creatools_bin/bbtkGEditorBin
76   sudo rm -rf creatools_bin/creaToolsBin
77
78   sudo rm -rf creatools_install/lib/creatools
79   sudo rm -rf creatools_install/lib64/creatools
80   sudo rm -rf creatools_install/bin/bb*
81   sudo rm -rf creatools_install/bin/crea*
82   sudo rm -rf creatools_install/include/bb*
83   sudo rm -rf creatools_install/include/crea*
84   sudo rm -rf creatools_install/share/bb*
85   sudo rm -rf creatools_install/share/crea*
86
87 #this is for the old versions EED
88   sudo rm -rf creatools_install/lib/crea*
89   sudo rm -rf creatools_install/lib/libbb*
90   sudo rm -rf creatools_install/lib/libcrea*
91   sudo rm -rf creatools_install/lib64/crea*
92   sudo rm -rf creatools_install/lib64/libbb*
93   sudo rm -rf creatools_install/lib64/libcrea*
94
95 fi
96
97 #if [ true = false ]
98 if [ true = true ]
99 then
100   sh $scriptDir/cvscheckout.sh $creasource                   $generationdir $cvsUserName
101   sh $scriptDir/cvscheckout.sh $bbtksource                   $generationdir $cvsUserName
102   sh $scriptDir/cvscheckout.sh $creamaracassource            $generationdir $cvsUserName
103   sh $scriptDir/cvscheckout.sh $creaenvironmentsource        $generationdir $cvsUserName
104   sh $scriptDir/cvscheckout.sh $creabrukersource             $generationdir $cvsUserName
105   sh $scriptDir/cvscheckout.sh $creaimagesource              $generationdir $cvsUserName
106   sh $scriptDir/cvscheckout.sh $creacontourssource           $generationdir $cvsUserName
107   sh $scriptDir/cvscheckout.sh $crearigidregistrationssource $generationdir $cvsUserName
108   sh $scriptDir/cvscheckout.sh $bbtkgeditorsource            $generationdir $cvsUserName
109   sh $scriptDir/cvscheckout.sh $creatoolssource              $generationdir $cvsUserName
110 fi
111
112
113 cd $scriptDir
114
115 # CREA
116 # the following stupid test is used at debug time; Please don't remove!
117 #if [ true = false ]
118 if [ true = true ]
119 then
120  sh cmakemod.sh         $creasource $generationdir $installPrefix $buildType 
121  sh creaVariables.sh    $creasource $generationdir $docgeneration
122  sh compilemod.sh       $buildType   $creasource $generationdir  
123  sh ctestmod.sh         $creasource $generationdir
124 fi
125  creadll=$generationdir/creatools_bin/creaBin
126  LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH
127  
128
129 # the following stupid test is used at debug time; Please don't remove!
130 #if [ true = false ]
131 if [ true = true ]
132 then
133 # BBTK
134  sh cmakemod.sh         $bbtksource $generationdir $installPrefix $buildType 
135  sh bbtkVariables.sh    $bbtksource $generationdir $docgeneration
136  sh compilemod.sh       $buildType $bbtksource $generationdir 
137  sh ctestmod.sh         $bbtksource $generationdir
138 fi
139  bbtkdll=$generationdir/creatools_bin/bbtkBin
140  LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
141
142 # the following stupid test is used at debug time; Please don't remove!
143 #if [ true = false ]
144 if [ true = true ]
145 then
146 # creaMaracasVisu
147  sh cmakemod.sh                 $creamaracassource $generationdir $installPrefix $buildType 
148  sh creaMaracasVariables.sh     $creamaracassource $generationdir $docgeneration
149  sh compilemod.sh               $buildType $creamaracassource $generationdir 
150  sh ctestmod.sh                 $creamaracassource $generationdir
151 fi
152
153  creamaracasdll=$generationdir/creatools_bin/creamaracasBin
154  LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_PATH
155
156 # the following stupid test is used at debug time; Please don't remove!
157 #if [ true = false ]
158 if [ true = true ]
159 then
160 # creaEnvironment
161  sh cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
162  sh creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
163  sh compilemod.sh $buildType    $creaenvironmentsource $generationdir
164  sh ctestmod.sh                 $creaenvironmentsource $generationdir
165 fi
166  creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
167  LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_PATH
168
169 # the following stupid test is used at debug time; Please don't remove!
170 #if [ true = false ]
171 if [ true = true ]
172 then
173 # creaBruker
174  sh cmakemod.sh                 $creabrukersource $generationdir $installPrefix $buildType 
175  sh creaBrukerVariables.sh      $creabrukersource $generationdir $docgeneration
176  sh compilemod.sh $buildType    $creabrukersource  $generationdir
177  echo generationdir 
178  sh ctestmod.sh                 $creabrukersource $generationdir
179 fi
180  creabrukerdll=$generationdir/creatools_bin/creabrukerBin
181  LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_PATH
182
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 # creaImageIO
188  sh cmakemod.sh                 $creaimagesource $generationdir $installPrefix $buildType 
189  sh creaImageIOVariables.sh     $creaimagesource $generationdir $docgeneration
190  sh compilemod.sh               $buildType $creaimagesource $generationdir
191  sh ctestmod.sh                 $creaimagesource $generationdir
192 fi
193  creaimagedll=$generationdir/creatools_bin/creaimageBin
194  LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_PATH
195
196 # the following stupid test is used at debug time; Please don't remove!
197 #if [ true = false ]
198 if [ true = true ]
199 then
200 # creaContours
201  sh cmakemod.sh                 $creacontourssource $generationdir $installPrefix $buildType 
202  sh creaContoursVariables.sh    $creacontourssource $generationdir $docgeneration
203  sh compilemod.sh               $buildType $creacontourssource $generationdir
204  sh ctestmod.sh                 $creacontourssource $generationdir
205 fi
206 # creacontourdll=$generationdir/creatools_bin/creacontoursBin
207 # LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_PATH
208
209 # creaRigidRegistration
210
211 # the following stupid test is used at debug time; Please don't remove!
212 #if [ true = false ]
213 if [ true = true ]
214 then
215  sh cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
216  sh creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration
217  sh compilemod.sh                       $buildType $crearigidregistrationssource $generationdir
218  sh ctestmod.sh                         $crearigidregistrationssource $generationdir
219 fi
220 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
221 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
222
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 # bbtkGEditor
228  sh cmakemod.sh                 $bbtkgeditorsource $generationdir $installPrefix $buildType 
229  sh bbtkGEditorVariables.sh     $bbtkgeditorsource $generationdir $docgeneration
230  sh compilemod.sh               $buildType $bbtkgeditorsource $generationdir
231  sh ctestmod.sh                 $bbtkgeditorsource $generationdir
232 fi
233 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
234 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
235
236 # the following stupid test is used at debug time; Please don't remove!
237 #if [ true = false ]
238 if [ true = true ]
239 then
240 # creaTools
241  sh cmakemod.sh                    $creatoolssource $generationdir $installPrefix $buildType 
242  sh creaToolsVariables.sh          $creatoolssource $generationdir $docgeneration
243  sh compilemod.sh                  $buildType $creatoolssource $generationdir
244 fi
245 # sh ctestmod.sh $creatoolsbinary $generationdir
246 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
247 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
248
249
250
251 CREATOOLS_INSTALL_DIR=$installPrefix
252 sudo rm $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
253 sudo echo export PATH=$PATH:$CREATOOLS_INSTALL_DIR/bin                                  >> $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
254 sudo echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$THIRDPARTY_INSTALL_DIR/lib/creatools >> $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
255
256 #  modify .bashrc
257 # - remove line 'sh $installPrefix/creatools_install/share/creatools_base_party_libraries_config.sh' if any (with accurate value for ???)
258 sed -i -e 's/.*creatools_base_libraries_config.*/  /g' ~/.bashrc
259
260 # - add line 'sh $installPrefix/creatools_install/share/creatools_base_libraries_config.sh' (with accurate value for ???)
261 echo sh $CREATOOLS_INSTALL_DIR/share/creatools_base_libraries_config.sh >> ~/.bashrc 
262
263
264 # shutdown /s
265 # exit /b