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 ETC_BASHRC=$HOME/.bashrc ]
91 export ETC_BASHRC=$HOME/.bashrc
93 if [ -f ETC_BASHRC=$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" = "" ]
167 generationdir=$racine
169 echo "you said : [" $generationdir "]"
174 installPrefixThird="___"
175 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
176 read installPrefixThird
177 if [ "$installPrefixThird" = "" ]
179 installPrefixThird="$generationdir/thirdparty_install"
181 echo "you said : [" $installPrefixThird "]"
187 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
189 if [ "$installPrefix" = "" ]
191 installPrefix="$generationdir/creatools_install"
193 echo "you said : [" $installPrefix "]"
201 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
203 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
205 if [ "$docgeneration" = "" ]
209 echo "you said : [" $docgeneration "]"
220 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
222 echo "Where do you want to get source files from : CVS/HTML ( CVS : for registered CREATIS users only! )"
224 if [ "$sourcesFrom" = "" ]
228 echo "you said : [" $sourcesFrom "]"
235 if [ "$sourcesFrom" = "CVS" ]
237 while [ "$cvsUserName" == "" ]
239 echo "CVS User Name ( registered CREATIS user : mandatory!)"
242 echo "you said : [" $cvsUserName "]"
244 cvsUserName="ForgetThisOne"
253 #while [ "$loginUserName" == "" ]
255 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
257 # echo "Login User Name (mandatory!)"
259 # echo "you said : [" $loginUserName "]"
265 while [ "$loginGroupName" == "" ]
267 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
268 echo "Login Group Name (mandatory!)"
270 echo "you said : [" $loginGroupName "]"
277 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
279 echo "Build type : Release/Debug (default is Release)"
281 if [ "$buildType" = "" ]
285 echo "you said : [" $buildType "]"
292 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion " != "GDCM2" ]]
294 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
296 if [ "$gdcmVersion" = "" ]
300 echo "you said : [" $gdcmVersion "]"
307 echo " Operating System : $OperatingSystem"
308 echo " Number of Cores : $corenumber"
309 echo " Name of the Generation Directory : $generationdir"
310 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
311 echo " Install Prefix for CreaTools : $installPrefix"
312 echo " Boolean for Doc Generation : $docgeneration"
313 echo " Where do you want to get source files from : $sourcesFrom"
314 if [ $sourcesFrom = CVS ]
316 echo " CVS User Name : $cvsUserName"
318 echo " Login User Name : $loginUserName"
319 echo " Login Group Name : $loginGroupName"
320 echo " Build type : $buildType"
321 echo " Gdcm version : $gdcmVersion"
325 echo "Do you confirm your choices : YES/NO ? (default is YES)"
327 if [ "$confirm" = "" ]
333 # GROS SOUCIS : Ou generer le fichier CreaTools-configure.sh?
334 # dans $generationdir/creatools_bin ?
335 # -> il n'est pas encore cree !
336 # dans ./Linux/scripts?
337 # ==> On le genere chez l'utilisateur (no choice!)...
340 configureFile="scripts/CreaTools-configure.sh"
342 echo "#!/bin/bash" > $configureFile
343 echo >> $configureFile
344 echo "#File generated by 'menu.sh'" >> $configureFile
345 echo "#DO NOT edit !" >> $configureFile
346 echo "#(except if you *do* know what you do)" >> $configureFile
347 echo >> $configureFile
348 echo "OperatingSystem=$OperatingSystem" >> $configureFile
349 echo "corenumber=$corenumber" >> $configureFile
350 echo "generationdir=$generationdir" >> $configureFile
351 echo "installPrefix=$installPrefix" >> $configureFile
352 echo "installPrefixThird=$installPrefixThird" >> $configureFile
353 echo "docgeneration=$docgeneration" >> $configureFile
354 echo "sourcesFrom=$sourcesFrom" >> $configureFile
355 echo "cvsUserName=$cvsUserName" >> $configureFile
356 echo "loginUserName=$loginUserName" >> $configureFile
357 echo "loginGroupName=$loginGroupName" >> $configureFile
358 echo "buildType=$buildType" >> $configureFile
359 echo "gdcmVersion=$gdcmVersion" >> $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!"
397 echo "========================== 1.0 "
398 source scripts/Check-if-root.sh
399 bash scripts/ThirdParty-install-Base-Stuff.sh
400 bash scripts/ThirdParty-install-Finalize.sh
404 echo "========================== 1.1 "
405 #source scripts/Check-if-root.sh
406 bash scripts/ThirdParty-install-VTK.sh
407 bash scripts/ThirdParty-install-Finalize.sh
412 echo "========================== 1.2 "
413 #source scripts/Check-if-root.sh
414 bash scripts/ThirdParty-install-gdcm.sh
415 bash scripts/ThirdParty-install-Finalize.sh
419 echo "========================== 1.3 "
420 #source scripts/Check-if-root.sh
421 bash scripts/ThirdParty-install-ITK.sh
422 bash scripts/ThirdParty-install-Finalize.sh
429 bash scripts/CreaTools-load.sh
431 source scripts/CreaTools-configure.sh
432 bash scripts/CreaTools-compile.sh
434 bash scripts/CreaTools-install.sh
436 echo "==> You HAVE to leave current window to continue!"
443 echo "========================== 2.1"
444 bash scripts/CreaTools-load.sh
448 echo "========================== 2.2"
449 source scripts/CreaTools-configure.sh
451 bash scripts/CreaTools-compile.sh
453 # To allow (*very* aware) user to patch code, later
454 if [ ! -e $generationdir/creatools_source ]
456 echo "You probabely made a mistake : "
457 echo "Directory $loginUserName $generationdir/creatools_source not found"
458 echo "Make sure you know the mistake"
459 echo "Hit any key to continue"
460 echo "Fix the mistake!"
463 chown -R $loginUserName $generationdir/creatools_source
464 chgrp -R $loginGroupName $generationdir/creatools_source
470 echo "========================= 4"
472 bash scripts/CreaTools-install.sh
476 # echo "You HAVE to leave current window to continue!"
478 # echo "==> Hit any key to close current window"
484 if [ $expanded = "NO" ]
493 echo "========================= 5"
494 bash scripts/CreaTools-uninstall.sh
496 echo "==> Hit any key to go on"
502 echo "==================================="
505 echo "==> Hit any key to go on"
511 echo "==================================="
513 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
514 # If user configured without installing third party library,
515 # last third party library is still in use! JPR
518 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
522 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
523 grep "installPrefixThird=" $ETC_BASHRC
524 echo "VTK_DIR : " $VTK_DIR
525 echo "ITK_DIR : " $ITK_DIR
526 echo "GDCM_DIR : " $GDCM_DIR
528 echo "installPrefixThird ... " $installPrefixThird
531 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
533 echo "Third party config file : " $installPrefixThird/share/creatools_third_party_library_config.sh
535 more $installPrefixThird/share/creatools_third_party_library_config.sh
541 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
543 echo "Creatools base library config file : " $installPrefix/share/creatools_base_library_config.sh
545 more $installPrefix/share/creatools_base_library_config.sh
548 echo "installPrefix ... " $installPrefix
551 echo "VTK_DIR : " $VTK_DIR
552 echo "ITK_DIR : " $ITK_DIR
553 echo "GDCM_DIR : " $GDCM_DIR
555 echo "crea_DIR : " $crea_DIR
556 echo "BBTK_DIR : " $BBTK_DIR
557 echo "creaMaracasVisu_DIR : " $creaMaracasVisu_DIR
558 echo "creaEnvironment_DIR : " $creaEnvironment_DIR
559 echo "creaBruker_DIR : " $creaBruker_DIR
560 echo "creaImageIO_DIR : " $creaImageIO_DIR
561 echo "creaContours_DIR : " $creaContours_DIR
562 echo "creaRigidRegistration_DIR :" $creaRigidRegistration_DIR
563 echo "bbtkGEditor_DIR : " $bbtkGEditor_DIR
564 echo "creaTools_DIR : " $creaTools_DIR
565 echo "creaMiniTools_DIR : " $creaMiniTools_DIR
566 echo "Ido_DIR : " $Ido_DIR
567 echo "==================================="
569 echo "Press any key to continue"
579 # Hiden option, usefull at debug time
580 bash scripts/ThirdParty-install_no_compile.sh
587 echo "Your answer must be in {0, 1, 2, 5, 6, 7, 8, 9} (was [ $i ])"
589 echo "Your answer must be in {0, 1, 2.1, 2.2, 2.3, 5, 6, 7, 8, 9} (was [ $i ])"