]> Creatis software - creaToolsTools.git/blob - Install/scripts/make.sh
6755d4506de8191e99bbd49b17f4d0186b962be9
[creaToolsTools.git] / Install / scripts / make.sh
1 #!/bin/sh
2
3 if [ $# = 0 ]
4 then
5 echo "Use it as :"
6 echo "sh make-install.sh <nameOfTheGenerationDirectory> <BooleanForDocGeneration> <userNameForCVS> <installPrefix> <buildType> <GDCM Version> <creaTools sources>"
7 echo "with 'installPrefix' : /usr/local or <directory where you want to generate>/creatools_install"
8 echo "with 'GDCM Version' : GDCM1 / GDCM2"
9 echo "with 'creaTools sources' :  where do you want to get them from ? CVS / HTML"
10 echo " "
11 echo "ex : sh make-install.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug GDCM2 HTML"
12 exit 0
13 fi
14
15 echo $#
16 echo "----------"
17 echo $0
18 echo $1
19 echo $2
20 echo $3
21 echo $4
22 echo $5
23 echo $6
24 echo $7
25 echo "----------"
26
27 if [ $# != 7 ]
28 then 
29 echo "Use it as :"
30 echo "sh make-install.sh <nameOfTheGenerationDirectory> <BooleanForDocGeneration> <userNameForCVS> <installPrefix> <buildType> <GDCM Version> <creaTools sources>"
31 echo "with 'installPrefix' : /usr/local or <directory where you want to generate>/creatools_install"
32 echo "with 'GDCM Version' : GDCM1 / GDCM2"
33 echo "with 'creaTools sources' :  where do you want to get them from ? CVS / HTML"
34 echo " "
35 echo "ex : sh make-install.sh /tmp/gendir OFF jpr /tmp/gendir/creatools_install Debug GDCM2 HTML"
36 exit 0
37 fi
38
39 # @echo off
40
41 #allow user to choose the generation dir
42 #allow user to choose to generate the doc or not
43 #allow user to choose where he wants to get the sources from : CVS / HTML
44
45 generationdir=$1
46 docgeneration=$2
47 cvsUserName=$3
48 installPrefix=$4
49 buildType=$5
50 gdcmVersion=$6
51 sourcesFrom=$7
52
53 scriptDir=$PWD
54
55  creasource=crea
56  bbtksource=bbtk
57  creamaracassource=creaMaracasVisu
58  creaenvironmentsource=creaEnvironment
59  creabrukersource=creaBruker
60  creaimagesource=creaImageIO
61  creacontourssource=creaContours
62  crearigidregistrationssource=creaRigidRegistration
63  bbtkgeditorsource=bbtkGEditor
64  creatoolssource=creaTools
65  
66 mkdir $generationdir
67 mkdir $generationdir/creatools_source
68 mkdir $generationdir/creatools_bin
69  
70 cd $generationdir
71
72 # start_point : used at debug time : start point of the script
73 # ex : if everything is OK, but bbtkGEditor, 
74 # cvs upate bbtkGEditor manually,and use :
75 # start_point=10
76 # in order not to cvs co everything, nor recompile everything.
77
78 start_point=0
79
80 # --------------------------------
81 #         start_point = 0 : remove everything that was created before
82 #---------------------------------
83 if [ $start_point -le 0 ]
84 then
85 # the following stupid test is used at debug time; Please don't remove!
86 #if [ true = false ]
87 if [ true = true ]
88 then
89   rm -rf creatools_bin
90   mkdir $generationdir/creatools_bin
91   rm -rf creatools_source
92   mkdir $generationdir/creatools_source
93 fi
94 fi
95
96 # ----------------------------------
97 #         start_point =  1 : Load all sources
98 #-----------------------------------
99
100
101 if [ $start_point -le 1 ]
102 then
103    if [ true = true ]
104    #if [ true = false ]
105    then
106 #
107       if [ $sourcesFrom = CVS ]
108       then
109          sh $scriptDir/cvscheckout.sh $creasource                   $generationdir $cvsUserName
110          sh $scriptDir/cvscheckout.sh $bbtksource                   $generationdir $cvsUserName
111          sh $scriptDir/cvscheckout.sh $creamaracassource            $generationdir $cvsUserName
112          sh $scriptDir/cvscheckout.sh $creaenvironmentsource        $generationdir $cvsUserName
113          sh $scriptDir/cvscheckout.sh $creabrukersource             $generationdir $cvsUserName
114          sh $scriptDir/cvscheckout.sh $creaimagesource              $generationdir $cvsUserName
115          sh $scriptDir/cvscheckout.sh $creacontourssource           $generationdir $cvsUserName
116          sh $scriptDir/cvscheckout.sh $crearigidregistrationssource $generationdir $cvsUserName
117          sh $scriptDir/cvscheckout.sh $bbtkgeditorsource            $generationdir $cvsUserName
118          sh $scriptDir/cvscheckout.sh $creatoolssource              $generationdir $cvsUserName
119       fi
120
121       if [ $sourcesFrom = HTML ]
122       then
123          cd $generationdir/creatools_source
124          
125          wget  http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/crea.tgz
126          wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/bbtk.tgz
127          wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/creaMaracasVisu.tgz
128          wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/creaEnvironment.tgz
129          wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/creaBruker.tgz
130          wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/creaImageIO.tgz
131          wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/creaContours.tgz
132          wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/creaRigidRegistration.tgz
133          wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/nightly/bbtkGEditor.tgz
134                          
135          tar xvzf crea.tgz
136          tar xvzf bbtk.tgz
137          tar xvzf creaMaracasVisu.tgz
138          tar xvzf creaEnvironment.tgz            
139          tar xvzf creaBruker.tgz
140          tar xvzf creaImageIO.tgz
141          tar xvzf creaContours.tgz
142          tar xvzf creaRigidRegistration.tgz
143          tar xvzf bbtkGEditor.tgz                                
144       fi
145    fi
146 fi
147
148 cd $scriptDir
149
150 # -------------------------
151 #        start_point =  2 : CREA
152 #-------------------------
153 if [ $start_point -le 2 ]
154 then
155 # CREA
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  sh cmakemod.sh                  $creasource $generationdir $installPrefix $buildType 
161  sh creaVariables.sh             $creasource $generationdir $docgeneration
162  sh compilemod.sh     $buildType $creasource $generationdir  
163  sh ctestmod.sh                  $creasource $generationdir
164 fi
165 fi
166  creadll=$generationdir/creatools_bin/creaBin
167  LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH
168
169
170
171 # -------------------------
172 #        start_point =  3 : BBTK
173 #-------------------------
174 if [ $start_point -le 3 ]
175 then
176 # the following stupid test is used at debug time; Please don't remove!
177 #if [ true = false ]
178 if [ true = true ]
179 then
180 # BBTK
181  sh cmakemod.sh       $bbtksource $generationdir $installPrefix $buildType 
182  sh bbtkVariables.sh  $bbtksource $generationdir $docgeneration $gdcmVersion
183  sh compilemod.sh     $buildType  $bbtksource $generationdir 
184  sh ctestmod.sh       $bbtksource $generationdir
185 fi
186 fi
187  bbtkdll=$generationdir/creatools_bin/bbtkBin
188  LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
189
190
191 # -------------------------
192 #        start_point =  4 : creaMaracasVisu
193 #-------------------------
194 if [ $start_point -le 4 ]
195 then
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 # creaMaracasVisu
201  sh cmakemod.sh                $creamaracassource $generationdir $installPrefix $buildType 
202  sh creaMaracasVariables.sh    $creamaracassource $generationdir $docgeneration
203  sh compilemod.sh              $buildType $creamaracassource $generationdir 
204  sh ctestmod.sh                $creamaracassource $generationdir
205 fi
206 fi
207  creamaracasdll=$generationdir/creatools_bin/creamaracasBin
208  LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_PATH
209
210
211 # -------------------------
212 #        start_point =  5 : creaEnvironment
213 #-------------------------
214 if [ $start_point -le 5 ]
215 then
216 # the following stupid test is used at debug time; Please don't remove!
217 #if [ true = false ]
218 if [ true = true ]
219 then
220 # creaEnvironment
221  sh cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
222  sh creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
223  sh compilemod.sh $buildType    $creaenvironmentsource $generationdir
224  sh ctestmod.sh                 $creaenvironmentsource $generationdir
225 fi
226 fi
227  creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
228  LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_PATH
229
230
231 # -------------------------
232 #        start_point =  6 : creaBruker
233 #-------------------------
234 if [ $start_point -le 6 ]
235 then
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 # creaBruker
241  sh cmakemod.sh              $creabrukersource $generationdir $installPrefix $buildType 
242  sh creaBrukerVariables.sh   $creabrukersource $generationdir $docgeneration $gdcmVersion
243  sh compilemod.sh $buildType $creabrukersource $generationdir
244  sh ctestmod.sh              $creabrukersource $generationdir
245 fi
246 fi
247  creabrukerdll=$generationdir/creatools_bin/creabrukerBin
248  LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_PATH
249
250
251 # -------------------------
252 #        start_point =  7 : creaImageIO
253 #-------------------------
254 if [ $start_point -le 7 ]
255 then
256  # the following stupid test is used at debug time; Please don't remove!
257 #if [ true = false ]
258 if [ true = true ]
259 then
260 # creaImageIO
261  sh cmakemod.sh              $creaimagesource $generationdir $installPrefix $buildType 
262  sh creaImageIOVariables.sh  $creaimagesource $generationdir $docgeneration $gdcmVersion
263  sh compilemod.sh    $buildType $creaimagesource $generationdir
264  sh ctestmod.sh              $creaimagesource $generationdir
265 fi
266 fi
267  creaimagedll=$generationdir/creatools_bin/creaimageBin
268  LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_PATH
269
270
271 # -------------------------
272 #        start_point =  8 : creaContour
273 #-------------------------
274 if [ $start_point -le 8 ]
275 then
276 # the following stupid test is used at debug time; Please don't remove!
277 #if [ true = false ]
278 if [ true = true ]
279 then
280 # creaContours
281  sh cmakemod.sh              $creacontourssource $generationdir $installPrefix $buildType 
282  sh creaContoursVariables.sh $creacontourssource $generationdir $docgeneration
283  sh compilemod.sh    $buildType $creacontourssource $generationdir
284  sh ctestmod.sh              $creacontourssource $generationdir
285 fi
286 fi
287 # creacontourdll=$generationdir/creatools_bin/creacontoursBin
288 # LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_PATH
289
290
291 # -------------------------
292 #        start_point =  9 : creaRigidRegistration
293 #-------------------------
294 if [ $start_point -le 9 ]
295 then
296 # the following stupid test is used at debug time; Please don't remove!
297 #if [ true = false ]
298 if [ true = true ]
299 then
300  sh cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
301  sh creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration
302  sh compilemod.sh            $buildType $crearigidregistrationssource $generationdir
303  sh ctestmod.sh                         $crearigidregistrationssource $generationdir
304 fi
305 fi
306 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
307 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
308
309
310 # -------------------------
311 #        start_point =  10 : bbtkGEditor
312 #-------------------------
313 if [ $start_point -le 10 ]
314 then
315 # the following stupid test is used at debug time; Please don't remove!
316 #if [ true = false ]
317 if [ true = true ]
318 then
319 # bbtkGEditor
320  sh cmakemod.sh              $bbtkgeditorsource $generationdir $installPrefix $buildType 
321  sh bbtkGEditorVariables.sh  $bbtkgeditorsource $generationdir $docgeneration
322  sh compilemod.sh    $buildType $bbtkgeditorsource $generationdir
323  sh ctestmod.sh              $bbtkgeditorsource $generationdir
324 fi
325 fi
326 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
327 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
328
329
330 # -------------------------
331 #        start_point =  11 : creaTools
332 #-------------------------
333 if [ $start_point -le 11 ]
334 then
335 # the following stupid test is used at debug time; Please don't remove!
336 #if [ true = false ]
337 if [ true = true ]
338 then
339 # creaTools
340  sh cmakemod.sh                $creatoolssource $generationdir $installPrefix $buildType 
341  sh creaToolsVariables.sh      $creatoolssource $generationdir $docgeneration
342  sh compilemod.sh   $buildType $creatoolssource $generationdir
343 fi
344 fi
345
346
347 # sh ctestmod.sh $creatoolsbinary $generationdir
348 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
349 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
350
351 # shutdown /s
352 # exit /b