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"
29 echo " Get, Compile, Install Wx (for Mac Users) :…....1.4"
32 echo " Install Third Party Libraries :....1 (as root)"
35 if [ $expanded = "YES" ]
37 echo " Get the 'CreaTools' source files :.2.1 (CVS : as user!)"
38 echo " Compile the CreaTools :..........2.2"
39 # Install creatools as user (no longer as root) // JPR 2/5/2011
40 echo " Install the CreaTools :..........2.3"
42 echo " Get and Install the 'CreaTools':...2"
45 if [ $expanded = "NO" ]
47 echo " Use Expanded menu :................5 "
49 echo " Use compact menu :.................5 "
51 echo " Uninstall the CreaTools :..........6 "
52 echo " Help ..............................7 Help about this menu"
53 echo " Show some Environment Variables ...8"
54 echo " Exit :.............................9"
59 echo "Type in your choice :"
65 # Do it, while we are under user, not under root! # JPR
66 if [ -f $HOME/.bashrc ]
68 export ETC_BASHRC=$HOME/.bashrc
70 if [ -f $HOME/.profile ]
72 export ETC_BASHRC=$HOME/.profile
74 echo "======================== BIG TROUBLE : neither $HOME/.bashrc nor $HOME/.profile file found"
75 echo "======================== You'd better to abort the program and (try to) fix the issue"
76 read a # just to let the user time enough to read the message...
82 #ls -l scripts/CreaTools-configure.sh
83 if [ -f scripts/CreaTools-configure.sh ]
85 while [[ "$suitable" != "YES" && \
86 "$suitable" != "yes" && \
87 "$suitable" != "Y" && \
88 "$suitable" != "y" && \
89 "$suitable" != "NO" && \
90 "$suitable" != "no" ]]
92 echo "'Configure' already done; Content of scripts/CreaTools-configure.sh :"
93 echo "------------------------"
94 more scripts/CreaTools-configure.sh
95 echo "------------------------"
97 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
98 # If user configured without installing third party library,
99 # last third party library is still in use! JPR
101 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
104 echo "the curently used Third Party libraries are NOT in $installPrefixThird but ... in :"
105 grep "installPrefixThird=" $ETC_BASHRC
106 echo "VTK_DIR : " $VTK_DIR
107 echo "ITK_DIR : " $ITK_DIR
108 echo "GDCM_DIR : " $GDCM_DIR
109 echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)"
112 echo "Are these values suitable for you : YES/NO? (default is YES)"
114 if [ "$suitable" = "" ]
123 if [[ "$suitable" = "YES" || "$suitable" = "Y" || "$suitable" = "yes" || "$suitable" = "y" ]]
125 source scripts/CreaTools-configure.sh
128 if [[ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]]
129 #if [ "$suitable" = "NO" ]
134 while [ "$confirm" != "YES" ]
136 # ///\TODO what about SuSE? Debian? Mandriva? Gentoo?
137 OperatingSystem="XXX"
138 while [[ "$OperatingSystem" != "Fedora" && \
139 "$OperatingSystem" != "Ubuntu" && \
140 "$OperatingSystem" != "MacOS" ]]
142 echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
144 if [ "$OperatingSystem" = "" ]
146 OperatingSystem="Fedora"
149 echo "you said : [" $OperatingSystem "]"
154 echo "How many cores on your computer 2 (default is 2)"
156 if [ "$corenumber" = "" ]
160 echo "you said : [" $corenumber "]"
165 racine=$HOME/myDefaultCreatoolsGenerationDir
167 echo "Name of the Generation Directory (default is $racine)"
169 if [ "$generationdir" = "" ]
171 generationdir=$racine
173 echo "you said : [" $generationdir "]"
178 installPrefixThird="___"
179 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
180 read installPrefixThird
181 if [ "$installPrefixThird" = "" ]
183 installPrefixThird="$generationdir/thirdparty_install"
185 echo "you said : [" $installPrefixThird "]"
191 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
193 if [ "$installPrefix" = "" ]
195 installPrefix="$generationdir/creatools_install"
197 echo "you said : [" $installPrefix "]"
205 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
207 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
209 if [ "$docgeneration" = "" ]
213 echo "you said : [" $docgeneration "]"
224 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
226 echo "Where do you want to get source files from : CVS/HTML ( CVS : for registered CREATIS users only! )"
228 if [ "$sourcesFrom" = "" ]
232 echo "you said : [" $sourcesFrom "]"
239 if [ "$sourcesFrom" = "CVS" ]
241 while [ "$cvsUserName" == "" ]
243 echo "CVS User Name ( registered CREATIS user : mandatory!)"
246 echo "you said : [" $cvsUserName "]"
248 cvsUserName="ForgetThisOne"
257 #while [ "$loginUserName" == "" ]
259 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
261 # echo "Login User Name (mandatory!)"
263 # echo "you said : [" $loginUserName "]"
269 while [ "$loginGroupName" == "" ]
271 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
272 echo "Login Group Name (mandatory!)"
274 echo "you said : [" $loginGroupName "]"
281 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
283 echo "Build type : Release/Debug (default is Release)"
285 if [ "$buildType" = "" ]
289 echo "you said : [" $buildType "]"
296 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion" != "GDCM2" ]]
298 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
300 if [ "$gdcmVersion" = "" ]
304 echo "you said : [" $gdcmVersion "]"
307 # NOT YET CHECKED ! JPR
309 while [[ "$ITKVersion" != "ITK3" && "$ITKVersion" != "ITK4" ]]
311 echo "ITK version : ITK3/ITK4 (default is ITK3)"
313 if [ "$ITKVersion" = "" ]
317 echo "you said : [" $ITKVersion "]"
325 echo " Operating System : $OperatingSystem"
326 echo " Number of Cores : $corenumber"
327 echo " Name of the Generation Directory : $generationdir"
328 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
329 echo " Install Prefix for CreaTools : $installPrefix"
330 echo " Boolean for Doc Generation : $docgeneration"
331 echo " Where do you want to get source files from : $sourcesFrom"
332 if [ $sourcesFrom = CVS ]
334 echo " CVS User Name : $cvsUserName"
336 echo " Login User Name : $loginUserName"
337 echo " Login Group Name : $loginGroupName"
338 echo " Build type : $buildType"
339 echo " Gdcm version : $gdcmVersion"
340 echo " ITK version : $ITKVersion"
344 echo "Do you confirm your choices : YES/NO ? (default is YES)"
346 if [ "$confirm" = "" ]
352 # ==> On genere le fichier CreaTools-configure.sh genere chez l'utilisateur (no choice!)...
355 configureFile="scripts/CreaTools-configure.sh"
357 echo "#!/bin/bash" > $configureFile
358 echo >> $configureFile
359 echo "#File generated by 'menu.sh'" >> $configureFile
360 echo "#DO NOT edit !" >> $configureFile
361 echo "#(except if you *do* know what you do)" >> $configureFile
362 echo >> $configureFile
363 echo "OperatingSystem=$OperatingSystem" >> $configureFile
364 echo "corenumber=$corenumber" >> $configureFile
365 echo "generationdir=$generationdir" >> $configureFile
366 echo "installPrefix=$installPrefix" >> $configureFile
367 echo "installPrefixThird=$installPrefixThird" >> $configureFile
368 echo "docgeneration=$docgeneration" >> $configureFile
369 echo "sourcesFrom=$sourcesFrom" >> $configureFile
370 echo "cvsUserName=$cvsUserName" >> $configureFile
371 echo "loginUserName=$loginUserName" >> $configureFile
372 echo "loginGroupName=$loginGroupName" >> $configureFile
373 echo "buildType=$buildType" >> $configureFile
374 echo "gdcmVersion=$gdcmVersion" >> $configureFile
375 echo "ITKVersion=$ITKVersion" >> $configureFile
376 echo "ETC_BASHRC=$ETC_BASHRC" >> $configureFile
384 echo "========================== 1 "
385 source scripts/Check-if-root.sh
386 bash scripts/ThirdParty-install-Base-Stuff.sh
387 bash scripts/ThirdParty-install-VTK.sh
388 bash scripts/ThirdParty-install-gdcm.sh
389 bash scripts/ThirdParty-install-ITK.sh
390 bash scripts/ThirdParty-install.sh
391 bash scripts/ThirdParty-install-Finalize.sh
393 if [ "$sourcesFrom" = "CVS" ]
395 echo "----------------------------------------------------------------------"
397 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
398 echo "----------------------------------------------------------------------"
400 echo "----------------------------------------------------------------------"
402 echo "To go on, run again 'bash menu.sh' in a new window"
403 echo "----------------------------------------------------------------------"
407 echo "==> You HAVE to leave current window to continue!"
414 echo "========================== 1.0 "
415 source scripts/Check-if-root.sh
416 bash scripts/ThirdParty-install-Base-Stuff.sh
417 bash scripts/ThirdParty-install-Finalize.sh
421 echo "========================== 1.1 "
422 #source scripts/Check-if-root.sh
423 bash scripts/ThirdParty-install-VTK.sh
424 bash scripts/ThirdParty-install-Finalize.sh
428 echo "========================== 1.2 "
429 #source scripts/Check-if-root.sh
430 bash scripts/ThirdParty-install-gdcm.sh
431 bash scripts/ThirdParty-install-Finalize.sh
435 echo "========================== 1.3 "
436 #source scripts/Check-if-root.sh
437 bash scripts/ThirdParty-install-ITK.sh
438 bash scripts/ThirdParty-install-Finalize.sh
441 echo "========================== 1.4 "
442 #source scripts/Check-if-root.sh
443 bash scripts/ThirdParty-install-WX.sh
444 bash scripts/ThirdParty-install-Finalize.sh
450 bash scripts/CreaTools-load.sh
452 source scripts/CreaTools-configure.sh
453 bash scripts/CreaTools-compile.sh
455 bash scripts/CreaTools-install.sh
457 echo "==> You HAVE to leave current window to continue!"
465 echo "========================== 2.1"
466 bash scripts/CreaTools-load.sh
470 echo "========================== 2.2"
471 source scripts/CreaTools-configure.sh
473 bash scripts/CreaTools-compile.sh
475 # To allow (*very* aware) user to patch code, later
476 if [ ! -e $generationdir/creatools_source ]
478 echo "You probabely made a mistake : "
479 echo "Directory $loginUserName $generationdir/creatools_source not found"
480 echo "Make sure you know the mistake"
481 echo "Hit any key to continue"
482 echo "Fix the mistake!"
485 chown -R $loginUserName $generationdir/creatools_source
486 chgrp -R $loginGroupName $generationdir/creatools_source
492 echo "========================= 4"
494 bash scripts/CreaTools-install.sh
498 # echo "You HAVE to leave current window to continue!"
500 # echo "==> Hit any key to close current window"
506 if [ $expanded = "NO" ]
515 echo "========================= 5"
516 bash scripts/CreaTools-uninstall.sh
518 echo "==> Hit any key to go on"
524 echo "==================================="
527 echo "==> Hit any key to go on"
533 echo "==================================="
535 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
536 # If user configured without installing third party library,
537 # last third party library is still in use! JPR
540 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
544 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
545 grep "installPrefixThird=" $ETC_BASHRC
546 echo "VTK_DIR : " $VTK_DIR
547 echo "ITK_DIR : " $ITK_DIR
548 echo "GDCM_DIR : " $GDCM_DIR
550 echo "installPrefixThird ... " $installPrefixThird
553 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
555 echo "Third party config file : " $installPrefixThird/share/creatools_third_party_library_config.sh
557 more $installPrefixThird/share/creatools_third_party_library_config.sh
563 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
565 echo "Creatools base library config file : " $installPrefix/share/creatools_base_library_config.sh
567 more $installPrefix/share/creatools_base_library_config.sh
570 echo "installPrefix ... " $installPrefix
573 echo "VTK_DIR : " $VTK_DIR
574 echo "ITK_DIR : " $ITK_DIR
575 echo "GDCM_DIR : " $GDCM_DIR
577 echo "crea_DIR : " $crea_DIR
578 echo "BBTK_DIR : " $BBTK_DIR
579 echo "creaMaracasVisu_DIR : " $creaMaracasVisu_DIR
580 echo "creaEnvironment_DIR : " $creaEnvironment_DIR
581 echo "creaBruker_DIR : " $creaBruker_DIR
582 echo "creaImageIO_DIR : " $creaImageIO_DIR
583 echo "creaContours_DIR : " $creaContours_DIR
584 echo "creaRigidRegistration_DIR :" $creaRigidRegistration_DIR
585 echo "bbtkGEditor_DIR : " $bbtkGEditor_DIR
586 echo "creaTools_DIR : " $creaTools_DIR
587 echo "creaMiniTools_DIR : " $creaMiniTools_DIR
588 echo "Ido_DIR : " $Ido_DIR
589 echo "==================================="
591 echo "Press any key to continue"
601 # Hiden option, usefull at debug time
602 bash scripts/ThirdParty-install_no_compile.sh
609 echo "Your answer must be in {0, 1, 2, 5, 6, 7, 8, 9} (was [ $i ])"
611 echo "Your answer must be in {0, 1, 2.1, 2.2, 2.3, 5, 6, 7, 8, 9} (was [ $i ])"