]> Creatis software - creaToolsTools.git/blob - Install/scripts/make.sh
0be85d92b774faea22ca45764aa8e3f8143c9eb2
[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 [ $# != 6 ]
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 if [ $start_point -le 1 ]
100 then
101    if [ true = true ]
102    #if [ true = false ]
103    then
104 #
105       if [ $sourcesFrom = CVS ]
106       then
107          sh $scriptDir/cvscheckout.sh $creasource                   $generationdir $cvsUserName
108          sh $scriptDir/cvscheckout.sh $bbtksource                   $generationdir $cvsUserName
109          sh $scriptDir/cvscheckout.sh $creamaracassource            $generationdir $cvsUserName
110          sh $scriptDir/cvscheckout.sh $creaenvironmentsource        $generationdir $cvsUserName
111          sh $scriptDir/cvscheckout.sh $creabrukersource             $generationdir $cvsUserName
112          sh $scriptDir/cvscheckout.sh $creaimagesource              $generationdir $cvsUserName
113          sh $scriptDir/cvscheckout.sh $creacontourssource           $generationdir $cvsUserName
114          sh $scriptDir/cvscheckout.sh $crearigidregistrationssource $generationdir $cvsUserName
115          sh $scriptDir/cvscheckout.sh $bbtkgeditorsource            $generationdir $cvsUserName
116          sh $scriptDir/cvscheckout.sh $creatoolssource              $generationdir $cvsUserName
117       fi
118
119       if [ $sourcesFrom = HTML ]
120       then
121          echo
122          echo
123          echo
124          echo "Fix the name of the place with tar.gz file "      
125          echo
126          echo
127          echo
128          exit 0              
129          wget http://www.creatis.insa-lyon.fr/~davila/CreaTools/XXXXXXXX.tgz
130          tar xvzf XXXXXXX.tgz
131          
132       fi
133    fi
134 fi
135
136
137 cd $scriptDir
138
139 # -------------------------
140 #        start_point =  2 : CREA
141 #-------------------------
142 if [ $start_point -le 2 ]
143 then
144 # CREA
145 # the following stupid test is used at debug time; Please don't remove!
146 #if [ true = false ]
147 if [ true = true ]
148 then
149  sh cmakemod.sh                  $creasource $generationdir $installPrefix $buildType 
150  sh creaVariables.sh             $creasource $generationdir $docgeneration
151  sh compilemod.sh     $buildType $creasource $generationdir  
152  sh ctestmod.sh                  $creasource $generationdir
153 fi
154 fi
155  creadll=$generationdir/creatools_bin/creaBin
156  LD_LIBRARY_PATH=$creadll:LD_LIBRARY_$PATH
157
158
159
160 # -------------------------
161 #        start_point =  3 : BBTK
162 #-------------------------
163 if [ $start_point -le 3 ]
164 then
165 # the following stupid test is used at debug time; Please don't remove!
166 #if [ true = false ]
167 if [ true = true ]
168 then
169 # BBTK
170  sh cmakemod.sh       $bbtksource $generationdir $installPrefix $buildType 
171  sh bbtkVariables.sh  $bbtksource $generationdir $docgeneration $gdcmVersion
172  sh compilemod.sh     $buildType  $bbtksource $generationdir 
173  sh ctestmod.sh       $bbtksource $generationdir
174 fi
175 fi
176  bbtkdll=$generationdir/creatools_bin/bbtkBin
177  LD_LIBRARY_PATH=$bbtkdll:$LD_LIBRARY_PATH
178
179
180 # -------------------------
181 #        start_point =  4 : creaMaracasVisu
182 #-------------------------
183 if [ $start_point -le 4 ]
184 then
185 # the following stupid test is used at debug time; Please don't remove!
186 #if [ true = false ]
187 if [ true = true ]
188 then
189 # creaMaracasVisu
190  sh cmakemod.sh                $creamaracassource $generationdir $installPrefix $buildType 
191  sh creaMaracasVariables.sh    $creamaracassource $generationdir $docgeneration
192  sh compilemod.sh              $buildType $creamaracassource $generationdir 
193  sh ctestmod.sh                $creamaracassource $generationdir
194 fi
195 fi
196  creamaracasdll=$generationdir/creatools_bin/creamaracasBin
197  LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_PATH
198
199
200 # -------------------------
201 #        start_point =  5 : creaEnvironment
202 #-------------------------
203 if [ $start_point -le 5 ]
204 then
205 # the following stupid test is used at debug time; Please don't remove!
206 #if [ true = false ]
207 if [ true = true ]
208 then
209 # creaEnvironment
210  sh cmakemod.sh                 $creaenvironmentsource $generationdir $installPrefix $buildType 
211  sh creaenvironmentVariables.sh $creaenvironmentsource $generationdir $docgeneration
212  sh compilemod.sh $buildType    $creaenvironmentsource $generationdir
213  sh ctestmod.sh                 $creaenvironmentsource $generationdir
214 fi
215 fi
216  creaenvironmentdll=$generationdir/creatools_bin/creaenvironmentBin
217  LD_LIBRARY_PATH=$creaenvironmentdll:$LD_LIBRARY_PATH
218
219
220 # -------------------------
221 #        start_point =  6 : creaBruker
222 #-------------------------
223 if [ $start_point -le 6 ]
224 then
225 # the following stupid test is used at debug time; Please don't remove!
226 #if [ true = false ]
227 if [ true = true ]
228 then
229 # creaBruker
230  sh cmakemod.sh              $creabrukersource $generationdir $installPrefix $buildType 
231  sh creaBrukerVariables.sh   $creabrukersource $generationdir $docgeneration $gdcmVersion
232  sh compilemod.sh $buildType $creabrukersource $generationdir
233  sh ctestmod.sh              $creabrukersource $generationdir
234 fi
235 fi
236  creabrukerdll=$generationdir/creatools_bin/creabrukerBin
237  LD_LIBRARY_PATH=$creabrukerdll:$LD_LIBRARY_PATH
238
239
240 # -------------------------
241 #        start_point =  7 : creaImageIO
242 #-------------------------
243 if [ $start_point -le 7 ]
244 then
245  # the following stupid test is used at debug time; Please don't remove!
246 #if [ true = false ]
247 if [ true = true ]
248 then
249 # creaImageIO
250  sh cmakemod.sh              $creaimagesource $generationdir $installPrefix $buildType 
251  sh creaImageIOVariables.sh  $creaimagesource $generationdir $docgeneration $gdcmVersion
252  sh compilemod.sh    $buildType $creaimagesource $generationdir
253  sh ctestmod.sh              $creaimagesource $generationdir
254 fi
255 fi
256  creaimagedll=$generationdir/creatools_bin/creaimageBin
257  LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_PATH
258
259
260 # -------------------------
261 #        start_point =  8 : creaContour
262 #-------------------------
263 if [ $start_point -le 8 ]
264 then
265 # the following stupid test is used at debug time; Please don't remove!
266 #if [ true = false ]
267 if [ true = true ]
268 then
269 # creaContours
270  sh cmakemod.sh              $creacontourssource $generationdir $installPrefix $buildType 
271  sh creaContoursVariables.sh $creacontourssource $generationdir $docgeneration
272  sh compilemod.sh    $buildType $creacontourssource $generationdir
273  sh ctestmod.sh              $creacontourssource $generationdir
274 fi
275 fi
276 # creacontourdll=$generationdir/creatools_bin/creacontoursBin
277 # LD_LIBRARY_PATH=$creacontoursdll:$LD_LIBRARY_PATH
278
279
280 # -------------------------
281 #        start_point =  9 : creaRigidRegistration
282 #-------------------------
283 if [ $start_point -le 9 ]
284 then
285 # the following stupid test is used at debug time; Please don't remove!
286 #if [ true = false ]
287 if [ true = true ]
288 then
289  sh cmakemod.sh                         $crearigidregistrationssource $generationdir $installPrefix $buildType 
290  sh creaRigidRegistrationVariables.sh   $crearigidregistrationssource $generationdir $docgeneration
291  sh compilemod.sh            $buildType $crearigidregistrationssource $generationdir
292  sh ctestmod.sh                         $crearigidregistrationssource $generationdir
293 fi
294 fi
295 # crearigidregistrationdll=$generationdir/creatools_bin/crearigidregistrationBin
296 # LD_LIBRARY_PATH=$crearigidregistrationdll:$LD_LIBRARY_PATH
297
298
299 # -------------------------
300 #        start_point =  10 : bbtkGEditor
301 #-------------------------
302 if [ $start_point -le 10 ]
303 then
304 # the following stupid test is used at debug time; Please don't remove!
305 #if [ true = false ]
306 if [ true = true ]
307 then
308 # bbtkGEditor
309  sh cmakemod.sh              $bbtkgeditorsource $generationdir $installPrefix $buildType 
310  sh bbtkGEditorVariables.sh  $bbtkgeditorsource $generationdir $docgeneration
311  sh compilemod.sh    $buildType $bbtkgeditorsource $generationdir
312  sh ctestmod.sh              $bbtkgeditorsource $generationdir
313 fi
314 fi
315 # bbtkgeditordll=$generationdir/creatools_bin/bbtkgeditorBin
316 # LD_LIBRARY_PATH=$bbtkgeditordll:$LD_LIBRARY_PATH
317
318
319 # -------------------------
320 #        start_point =  11 : creaTools
321 #-------------------------
322 if [ $start_point -le 11 ]
323 then
324 # the following stupid test is used at debug time; Please don't remove!
325 #if [ true = false ]
326 if [ true = true ]
327 then
328 # creaTools
329  sh cmakemod.sh                $creatoolssource $generationdir $installPrefix $buildType 
330  sh creaToolsVariables.sh      $creatoolssource $generationdir $docgeneration
331  sh compilemod.sh   $buildType $creatoolssource $generationdir
332 fi
333 fi
334
335
336 # sh ctestmod.sh $creatoolsbinary $generationdir
337 #  creatoolsdll=$generationdir/creatools_bin/creatoolsBin
338 #  LD_LIBRARY_PATH=$creatoolssdll:$LD_LIBRARY_PATH
339
340 # shutdown /s
341 # exit /b