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 :"
64 # Do it, while we are under user, not under root! # JPR
65 if [ -f $HOME/.bashrc ]
67 export ETC_BASHRC=$HOME/.bashrc
69 if [ -f $HOME/.profile ]
71 export ETC_BASHRC=$HOME/.profile
73 echo "======================== BIG TROUBLE : neither $HOME/.bashrc nor $HOME/.profile file found"
74 echo "======================== You'd better to abort the program and (try to) fix the issue"
75 read a # just to let the user time enough to read the message...
81 #ls -l scripts/CreaTools-configure.sh
82 if [ -f scripts/CreaTools-configure.sh ]
84 while [[ "$suitable" != "YES" && \
85 "$suitable" != "yes" && \
86 "$suitable" != "Y" && \
87 "$suitable" != "y" && \
88 "$suitable" != "NO" && \
89 "$suitable" != "no" ]]
91 echo "'Configure' already done; Content of scripts/CreaTools-configure.sh :"
92 echo "------------------------"
93 more scripts/CreaTools-configure.sh
94 echo "------------------------"
96 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
97 # If user configured without installing third party library,
98 # last third party library is still in use! JPR
100 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
103 echo "the curently used Third Party libraries are NOT in $installPrefixThird but ... in :"
104 grep "installPrefixThird=" $ETC_BASHRC
105 echo "VTK_DIR : " $VTK_DIR
106 echo "ITK_DIR : " $ITK_DIR
107 echo "GDCM_DIR : " $GDCM_DIR
108 echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)"
111 echo "Are these values suitable for you : YES/NO? (default is YES)"
113 if [ "$suitable" = "" ]
122 if [[ "$suitable" = "YES" || "$suitable" = "Y" || "$suitable" = "yes" || "$suitable" = "y" ]]
124 source scripts/CreaTools-configure.sh
127 if [[ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]]
128 #if [ "$suitable" = "NO" ]
133 while [ "$confirm" != "YES" ]
135 # ///\TODO what about SuSE? Debian? Mandriva? Gentoo?
136 OperatingSystem="XXX"
137 while [[ "$OperatingSystem" != "Fedora" && \
138 "$OperatingSystem" != "Ubuntu" && \
139 "$OperatingSystem" != "MacOS" ]]
141 echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
143 if [ "$OperatingSystem" = "" ]
145 OperatingSystem="Fedora"
148 echo "you said : [" $OperatingSystem "]"
153 echo "How many cores on your computer 2 (default is 2)"
155 if [ "$corenumber" = "" ]
159 echo "you said : [" $corenumber "]"
164 racine=$HOME/myDefaultCreatoolsGenerationDir
166 echo "Name of the Generation Directory (default is $racine)"
168 if [ "$generationdir" = "" ]
170 generationdir=$racine
172 echo "you said : [" $generationdir "]"
177 installPrefixThird="___"
178 echo "Install Prefix For Third Party Library : '$generationdir/thirdparty_install' / '/usr/local' (default is '$generationdir/thirdparty_install')"
179 read installPrefixThird
180 if [ "$installPrefixThird" = "" ]
182 installPrefixThird="$generationdir/thirdparty_install"
184 echo "you said : [" $installPrefixThird "]"
190 echo "Install Prefix for CreaTools : '$generationdir/creatools_install' / '/usr/local' (default is '$generationdir/creatools_install')"
192 if [ "$installPrefix" = "" ]
194 installPrefix="$generationdir/creatools_install"
196 echo "you said : [" $installPrefix "]"
204 while [[ "$docgeneration" != "ON" && "$docgeneration" != "OFF" ]]
206 echo "Boolean For Doc Generation : ON/OFF (default is OFF)"
208 if [ "$docgeneration" = "" ]
212 echo "you said : [" $docgeneration "]"
223 while [[ "$sourcesFrom" != "CVS" && "$sourcesFrom" != "HTML" ]]
225 echo "Where do you want to get source files from : CVS/HTML ( CVS : for registered CREATIS users only! )"
227 if [ "$sourcesFrom" = "" ]
231 echo "you said : [" $sourcesFrom "]"
238 if [ "$sourcesFrom" = "CVS" ]
240 while [ "$cvsUserName" == "" ]
242 echo "CVS User Name ( registered CREATIS user : mandatory!)"
245 echo "you said : [" $cvsUserName "]"
247 cvsUserName="ForgetThisOne"
256 #while [ "$loginUserName" == "" ]
258 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
260 # echo "Login User Name (mandatory!)"
262 # echo "you said : [" $loginUserName "]"
268 while [ "$loginGroupName" == "" ]
270 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
271 echo "Login Group Name (mandatory!)"
273 echo "you said : [" $loginGroupName "]"
280 while [[ "$buildType" != "Release" && "$buildType" != "Debug" ]]
282 echo "Build type : Release/Debug (default is Release)"
284 if [ "$buildType" = "" ]
288 echo "you said : [" $buildType "]"
295 while [[ "$gdcmVersion" != "GDCM1" && "$gdcmVersion" != "GDCM2" ]]
297 echo "Gdcm version : GDCM1/GDCM2 (default is GDCM1)"
299 if [ "$gdcmVersion" = "" ]
303 echo "you said : [" $gdcmVersion "]"
306 # NOT YET CHECKED ! JPR
308 while [[ "$ITKVersion" != "ITK3" && "$ITKVersion" != "ITK4" ]]
310 echo "ITK version : ITK3/ITK4 (default is ITK3)"
312 if [ "$ITKVersion" = "" ]
316 echo "you said : [" $ITKVersion "]"
324 echo " Operating System : $OperatingSystem"
325 echo " Number of Cores : $corenumber"
326 echo " Name of the Generation Directory : $generationdir"
327 echo " Install Prefix for Third Party Libraries : $installPrefixThird"
328 echo " Install Prefix for CreaTools : $installPrefix"
329 echo " Boolean for Doc Generation : $docgeneration"
330 echo " Where do you want to get source files from : $sourcesFrom"
331 if [ $sourcesFrom = CVS ]
333 echo " CVS User Name : $cvsUserName"
335 echo " Login User Name : $loginUserName"
336 echo " Login Group Name : $loginGroupName"
337 echo " Build type : $buildType"
338 echo " Gdcm version : $gdcmVersion"
339 echo " ITK version : $ITKVersion"
343 echo "Do you confirm your choices : YES/NO ? (default is YES)"
345 if [ "$confirm" = "" ]
351 # ==> On genere le fichier CreaTools-configure.sh genere chez l'utilisateur (no choice!)...
354 configureFile="scripts/CreaTools-configure.sh"
356 echo "#!/bin/bash" > $configureFile
357 echo >> $configureFile
358 echo "#File generated by 'menu.sh'" >> $configureFile
359 echo "#DO NOT edit !" >> $configureFile
360 echo "#(except if you *do* know what you do)" >> $configureFile
361 echo >> $configureFile
362 echo "OperatingSystem=$OperatingSystem" >> $configureFile
363 echo "corenumber=$corenumber" >> $configureFile
364 echo "generationdir=$generationdir" >> $configureFile
365 echo "installPrefix=$installPrefix" >> $configureFile
366 echo "installPrefixThird=$installPrefixThird" >> $configureFile
367 echo "docgeneration=$docgeneration" >> $configureFile
368 echo "sourcesFrom=$sourcesFrom" >> $configureFile
369 echo "cvsUserName=$cvsUserName" >> $configureFile
370 echo "loginUserName=$loginUserName" >> $configureFile
371 echo "loginGroupName=$loginGroupName" >> $configureFile
372 echo "buildType=$buildType" >> $configureFile
373 echo "gdcmVersion=$gdcmVersion" >> $configureFile
374 echo "ITKVersion=$ITKVersion" >> $configureFile
375 echo "ETC_BASHRC=$ETC_BASHRC" >> $configureFile
383 echo "========================== 1 "
384 source scripts/Check-if-root.sh
385 bash scripts/ThirdParty-install-Base-Stuff.sh
386 bash scripts/ThirdParty-install-VTK.sh
387 bash scripts/ThirdParty-install-gdcm.sh
388 bash scripts/ThirdParty-install-ITK.sh
389 bash scripts/ThirdParty-install.sh
390 bash scripts/ThirdParty-install-Finalize.sh
392 if [ "$sourcesFrom" = "CVS" ]
394 echo "----------------------------------------------------------------------"
396 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
397 echo "---------------------------------------------------------------------"
399 echo "----------------------------------------------------------------------"
401 echo "To go on, run again 'bash menu.sh' in a new window"
402 echo "---------------------------------------------------------------------"
406 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
443 bash scripts/CreaTools-load.sh
445 source scripts/CreaTools-configure.sh
446 bash scripts/CreaTools-compile.sh
448 bash scripts/CreaTools-install.sh
450 echo "==> You HAVE to leave current window to continue!"
458 echo "========================== 2.1"
459 bash scripts/CreaTools-load.sh
463 echo "========================== 2.2"
464 source scripts/CreaTools-configure.sh
466 bash scripts/CreaTools-compile.sh
468 # To allow (*very* aware) user to patch code, later
469 if [ ! -e $generationdir/creatools_source ]
471 echo "You probabely made a mistake : "
472 echo "Directory $loginUserName $generationdir/creatools_source not found"
473 echo "Make sure you know the mistake"
474 echo "Hit any key to continue"
475 echo "Fix the mistake!"
478 chown -R $loginUserName $generationdir/creatools_source
479 chgrp -R $loginGroupName $generationdir/creatools_source
485 echo "========================= 4"
487 bash scripts/CreaTools-install.sh
491 # echo "You HAVE to leave current window to continue!"
493 # echo "==> Hit any key to close current window"
499 if [ $expanded = "NO" ]
508 echo "========================= 5"
509 bash scripts/CreaTools-uninstall.sh
511 echo "==> Hit any key to go on"
517 echo "==================================="
520 echo "==> Hit any key to go on"
526 echo "==================================="
528 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
529 # If user configured without installing third party library,
530 # last third party library is still in use! JPR
533 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
537 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
538 grep "installPrefixThird=" $ETC_BASHRC
539 echo "VTK_DIR : " $VTK_DIR
540 echo "ITK_DIR : " $ITK_DIR
541 echo "GDCM_DIR : " $GDCM_DIR
543 echo "installPrefixThird ... " $installPrefixThird
546 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
548 echo "Third party config file : " $installPrefixThird/share/creatools_third_party_library_config.sh
550 more $installPrefixThird/share/creatools_third_party_library_config.sh
556 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
558 echo "Creatools base library config file : " $installPrefix/share/creatools_base_library_config.sh
560 more $installPrefix/share/creatools_base_library_config.sh
563 echo "installPrefix ... " $installPrefix
566 echo "VTK_DIR : " $VTK_DIR
567 echo "ITK_DIR : " $ITK_DIR
568 echo "GDCM_DIR : " $GDCM_DIR
570 echo "crea_DIR : " $crea_DIR
571 echo "BBTK_DIR : " $BBTK_DIR
572 echo "creaMaracasVisu_DIR : " $creaMaracasVisu_DIR
573 echo "creaEnvironment_DIR : " $creaEnvironment_DIR
574 echo "creaBruker_DIR : " $creaBruker_DIR
575 echo "creaImageIO_DIR : " $creaImageIO_DIR
576 echo "creaContours_DIR : " $creaContours_DIR
577 echo "creaRigidRegistration_DIR :" $creaRigidRegistration_DIR
578 echo "bbtkGEditor_DIR : " $bbtkGEditor_DIR
579 echo "creaTools_DIR : " $creaTools_DIR
580 echo "creaMiniTools_DIR : " $creaMiniTools_DIR
581 echo "Ido_DIR : " $Ido_DIR
582 echo "==================================="
584 echo "Press any key to continue"
594 # Hiden option, usefull at debug time
595 bash scripts/ThirdParty-install_no_compile.sh
602 echo "Your answer must be in {0, 1, 2, 5, 6, 7, 8, 9} (was [ $i ])"
604 echo "Your answer must be in {0, 1, 2.1, 2.2, 2.3, 5, 6, 7, 8, 9} (was [ $i ])"