3 if [ -f scripts/CreaTools-configure.sh ]
5 source scripts/CreaTools-configure.sh
18 echo " Choose what you want to do :"
20 echo " Configure :........................0"
22 if [ $expanded = "YES" ]
24 echo " Install all base stuff :..........1.0"
25 echo " (cmake, doxygen, graphviz, ...)"
26 echo " Get, Compile, Install vtk .......1.1"
27 echo " Get, Compile, Install gdcm :.. . .1.2"
28 echo " Get, Compile, Install itk :.......1.3"
31 echo " Install Third Party Libraries :....1 (as root)"
34 if [ $expanded = "YES" ]
36 echo " Get the 'CreaTools' source files :.2.1 (CVS : as user!)"
37 echo " Compile the CreaTools :..........2.2"
38 # Install creatools as user (no longer as root) // JPR 2/5/2011
39 echo " Install the CreaTools :..........2.3"
41 echo " Get and Install the 'CreaTools':...2"
44 if [ $expanded = "NO" ]
46 echo " Use Expanded menu :................5 "
48 echo " Use compact menu :.................5 "
50 echo " Uninstall the CreaTools :..........6 "
51 echo " Help ..............................7 Help about this menu"
52 echo " Show some Environment Variables ...8"
53 echo " Exit :.............................9"
58 echo "Type in your choice :"
65 #ls -l scripts/CreaTools-configure.sh
66 if [ -f scripts/CreaTools-configure.sh ]
68 while [[ "$suitable" != "YES" && \
69 "$suitable" != "yes" && \
70 "$suitable" != "Y" && \
71 "$suitable" != "y" && \
72 "$suitable" != "NO" && \
73 "$suitable" != "no" ]]
75 echo "'Configure' already done : "
76 echo "------------------------"
77 more scripts/CreaTools-configure.sh
78 echo "------------------------"
80 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
81 # If user configured without installing third party library,
82 # last third party library is still in use! JPR
85 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
89 if [ -f $HOME/.bashrc ]
91 export ETC_BASHRC=$HOME/.bashrc
93 if [ -f $HOME/.profile ]
95 export ETC_BASHRC=$HOME/.profile
98 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
100 grep "installPrefixThird=" $ETC_BASHRC
101 echo "VTK_DIR : " $VTK_DIR
102 echo "ITK_DIR : " $ITK_DIR
103 echo "GDCM_DIR : " $GDCM_DIR
104 echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)"
107 echo "Are these values suitable for you : YES/NO? (default is YES)"
109 if [ "$suitable" = "" ]
118 if [[ "$suitable" = "YES" || "$suitable" = "Y" || "$suitable" = "yes" || "$suitable" = "y" ]]
120 source scripts/CreaTools-configure.sh
123 if [[ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]]
124 #if [ "$suitable" = "NO" ]
129 while [ "$confirm" != "YES" ]
131 # ///\TODO what about SuSE? Debian? Mandriva? Gentoo?
132 OperatingSystem="XXX"
133 while [[ "$OperatingSystem" != "Fedora" && \
134 "$OperatingSystem" != "Ubuntu" && \
135 "$OperatingSystem" != "MacOS" ]]
137 echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
139 if [ "$OperatingSystem" = "" ]
141 OperatingSystem="Fedora"
144 echo "you said : [" $OperatingSystem "]"
149 echo "How many cores on your computer 2 (default is 2)"
151 if [ "$corenumber" = "" ]
155 echo "you said : [" $corenumber "]"
160 racine=$HOME/myDefaultCreatoolsGenerationDir
162 echo "Name of the Generation Directory (default is $racine)"
164 if [ "$generationdir" = "" ]
166 generationdir=$racine
168 echo "you said : [" $generationdir "]"
173 installPrefixThird="___"
174 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
175 read installPrefixThird
176 if [ "$installPrefixThird" = "" ]
178 installPrefixThird="$generationdir/thirdparty_install"
180 echo "you said : [" $installPrefixThird "]"
186 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
188 if [ "$installPrefix" = "" ]
190 installPrefix="$generationdir/creatools_install"
192 echo "you said : [" $installPrefix "]"
200 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
202 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
204 if [ "$docgeneration" = "" ]
208 echo "you said : [" $docgeneration "]"
219 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
221 echo "Where do you want to get source files from : CVS/HTML ( CVS : for registered CREATIS users only! )"
223 if [ "$sourcesFrom" = "" ]
227 echo "you said : [" $sourcesFrom "]"
234 if [ "$sourcesFrom" = "CVS" ]
236 while [ "$cvsUserName" == "" ]
238 echo "CVS User Name ( registered CREATIS user : mandatory!)"
241 echo "you said : [" $cvsUserName "]"
243 cvsUserName="ForgetThisOne"
252 #while [ "$loginUserName" == "" ]
254 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
256 # echo "Login User Name (mandatory!)"
258 # echo "you said : [" $loginUserName "]"
264 while [ "$loginGroupName" == "" ]
266 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
267 echo "Login Group Name (mandatory!)"
269 echo "you said : [" $loginGroupName "]"
276 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
278 echo "Build type : Release/Debug (default is Release)"
280 if [ "$buildType" = "" ]
284 echo "you said : [" $buildType "]"
291 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
293 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
295 if [ "$gdcmVersion" = "" ]
299 echo "you said : [" $gdcmVersion "]"
306 echo " Operating System : $OperatingSystem"
307 echo " Number of Cores : $corenumber"
308 echo " Name of the Generation Directory : $generationdir"
309 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
310 echo " Install Prefix for CreaTools : $installPrefix"
311 echo " Boolean for Doc Generation : $docgeneration"
312 echo " Where do you want to get source files from : $sourcesFrom"
313 if [ $sourcesFrom = CVS ]
315 echo " CVS User Name : $cvsUserName"
317 echo " Login User Name : $loginUserName"
318 echo " Login Group Name : $loginGroupName"
319 echo " Build type : $buildType"
320 echo " Gdcm version : $gdcmVersion"
324 echo "Do you confirm your choices : YES/NO ? (default is YES)"
326 if [ "$confirm" = "" ]
332 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
333 # dans $generationdir/creatools_bin ?
334 # -> il n'est pas encore cree !
335 # dans ./Linux/scripts?
336 # ==> On le genere chez l'utilisateur (no choice!)...
339 configureFile="scripts/CreaTools-configure.sh"
341 echo "#!/bin/bash" > $configureFile
342 echo >> $configureFile
343 echo "#File generated by 'menu.sh'" >> $configureFile
344 echo "#DO NOT edit !" >> $configureFile
345 echo "#(except if you *do* know what you do)" >> $configureFile
346 echo >> $configureFile
347 echo "OperatingSystem=$OperatingSystem" >> $configureFile
348 echo "corenumber=$corenumber" >> $configureFile
349 echo "generationdir=$generationdir" >> $configureFile
350 echo "installPrefix=$installPrefix" >> $configureFile
351 echo "installPrefixThird=$installPrefixThird" >> $configureFile
352 echo "docgeneration=$docgeneration" >> $configureFile
353 echo "sourcesFrom=$sourcesFrom" >> $configureFile
354 echo "cvsUserName=$cvsUserName" >> $configureFile
355 echo "loginUserName=$loginUserName" >> $configureFile
356 echo "loginGroupName=$loginGroupName" >> $configureFile
357 echo "buildType=$buildType" >> $configureFile
358 echo "gdcmVersion=$gdcmVersion" >> $configureFile
359 echo "ETC_BASHRC=$ETC_BASHRC" >> $configureFile
367 echo "========================== 1 "
368 source scripts/Check-if-root.sh
369 bash scripts/ThirdParty-install-Base-Stuff.sh
370 bash scripts/ThirdParty-install-VTK.sh
371 bash scripts/ThirdParty-install-gdcm.sh
372 bash scripts/ThirdParty-install-ITK.sh
373 bash scripts/ThirdParty-install.sh
374 bash scripts/ThirdParty-install-Finalize.sh
376 if [ "$sourcesFrom" = "CVS" ]
378 echo "----------------------------------------------------------------------"
380 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
381 echo "---------------------------------------------------------------------"
383 echo "----------------------------------------------------------------------"
385 echo "To go on, run again 'bash menu.sh' in a new window"
386 echo "---------------------------------------------------------------------"
390 echo "==> You HAVE to leave current window to continue!"
398 echo "========================== 1.0 "
399 source scripts/Check-if-root.sh
400 bash scripts/ThirdParty-install-Base-Stuff.sh
401 bash scripts/ThirdParty-install-Finalize.sh
405 echo "========================== 1.1 "
406 #source scripts/Check-if-root.sh
407 bash scripts/ThirdParty-install-VTK.sh
408 bash scripts/ThirdParty-install-Finalize.sh
413 echo "========================== 1.2 "
414 #source scripts/Check-if-root.sh
415 bash scripts/ThirdParty-install-gdcm.sh
416 bash scripts/ThirdParty-install-Finalize.sh
420 echo "========================== 1.3 "
421 #source scripts/Check-if-root.sh
422 bash scripts/ThirdParty-install-ITK.sh
423 bash scripts/ThirdParty-install-Finalize.sh
430 bash scripts/CreaTools-load.sh
432 source scripts/CreaTools-configure.sh
433 bash scripts/CreaTools-compile.sh
435 bash scripts/CreaTools-install.sh
437 echo "==> You HAVE to leave current window to continue!"
445 echo "========================== 2.1"
446 bash scripts/CreaTools-load.sh
450 echo "========================== 2.2"
451 source scripts/CreaTools-configure.sh
453 bash scripts/CreaTools-compile.sh
455 # To allow (*very* aware) user to patch code, later
456 if [ ! -e $generationdir/creatools_source ]
458 echo "You probabely made a mistake : "
459 echo "Directory $loginUserName $generationdir/creatools_source not found"
460 echo "Make sure you know the mistake"
461 echo "Hit any key to continue"
462 echo "Fix the mistake!"
465 chown -R $loginUserName $generationdir/creatools_source
466 chgrp -R $loginGroupName $generationdir/creatools_source
472 echo "========================= 4"
474 bash scripts/CreaTools-install.sh
478 # echo "You HAVE to leave current window to continue!"
480 # echo "==> Hit any key to close current window"
487 if [ $expanded = "NO" ]
496 echo "========================= 5"
497 bash scripts/CreaTools-uninstall.sh
499 echo "==> Hit any key to go on"
505 echo "==================================="
508 echo "==> Hit any key to go on"
514 echo "==================================="
516 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
517 # If user configured without installing third party library,
518 # last third party library is still in use! JPR
521 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
525 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
526 grep "installPrefixThird=" $ETC_BASHRC
527 echo "VTK_DIR : " $VTK_DIR
528 echo "ITK_DIR : " $ITK_DIR
529 echo "GDCM_DIR : " $GDCM_DIR
531 echo "installPrefixThird ... " $installPrefixThird
534 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
536 echo "Third party config file : " $installPrefixThird/share/creatools_third_party_library_config.sh
538 more $installPrefixThird/share/creatools_third_party_library_config.sh
544 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
546 echo "Creatools base library config file : " $installPrefix/share/creatools_base_library_config.sh
548 more $installPrefix/share/creatools_base_library_config.sh
551 echo "installPrefix ... " $installPrefix
554 echo "VTK_DIR : " $VTK_DIR
555 echo "ITK_DIR : " $ITK_DIR
556 echo "GDCM_DIR : " $GDCM_DIR
558 echo "crea_DIR : " $crea_DIR
559 echo "BBTK_DIR : " $BBTK_DIR
560 echo "creaMaracasVisu_DIR : " $creaMaracasVisu_DIR
561 echo "creaEnvironment_DIR : " $creaEnvironment_DIR
562 echo "creaBruker_DIR : " $creaBruker_DIR
563 echo "creaImageIO_DIR : " $creaImageIO_DIR
564 echo "creaContours_DIR : " $creaContours_DIR
565 echo "creaRigidRegistration_DIR :" $creaRigidRegistration_DIR
566 echo "bbtkGEditor_DIR : " $bbtkGEditor_DIR
567 echo "creaTools_DIR : " $creaTools_DIR
568 echo "creaMiniTools_DIR : " $creaMiniTools_DIR
569 echo "Ido_DIR : " $Ido_DIR
570 echo "==================================="
572 echo "Press any key to continue"
582 # Hiden option, usefull at debug time
583 bash scripts/ThirdParty-install_no_compile.sh
590 echo "Your answer must be in {0, 1, 2, 5, 6, 7, 8, 9} (was [ $i ])"
592 echo "Your answer must be in {0, 1, 2.1, 2.2, 2.3, 5, 6, 7, 8, 9} (was [ $i ])"