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 # Install creatools as user (no longer as root) // JPR 2/5/2011
90 #if [ ! -f /etc/bashrc ]
92 # export ETC_BASHRC="/etc/bash.bashrc"
94 # export ETC_BASHRC="/etc/bashrc"
96 export ETC_BASHRC=$HOME/.bashrc
97 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
99 grep "installPrefixThird=" $ETC_BASHRC
100 echo "VTK_DIR : " $VTK_DIR
101 echo "ITK_DIR : " $ITK_DIR
102 echo "GDCM_DIR : " $GDCM_DIR
103 echo "(Have a look at $ETC_BASHRC=, edit it or run again Install Third Party Libraries if you disagree)"
106 echo "Are these values suitable for you : YES/NO? (default is YES)"
108 if [ "$suitable" = "" ]
117 if [[ "$suitable" = "YES" || "$suitable" = "Y" || "$suitable" = "yes" || "$suitable" = "y" ]]
119 source scripts/CreaTools-configure.sh
122 if [[ "$suitable" = "NO" || "$suitable" = "N" || "$suitable" = "no" || "$suitable" = "n" ]]
123 #if [ "$suitable" = "NO" ]
128 while [ "$confirm" != "YES" ]
130 # ///\TODO what about SuSE? Debian? Mandriva? Gentoo?
131 OperatingSystem="XXX"
132 while [[ "$OperatingSystem" != "Fedora" && \
133 "$OperatingSystem" != "Ubuntu" && \
134 "$OperatingSystem" != "MacOS" ]]
136 echo "Operating System : Fedora/Ubuntu/MacOS (default : Fedora)"
138 if [ "$OperatingSystem" = "" ]
140 OperatingSystem="Fedora"
143 echo "you said : [" $OperatingSystem "]"
148 echo "How many cores on your computer 2 (default is 2)"
150 if [ "$corenumber" = "" ]
154 echo "you said : [" $corenumber "]"
159 racine=$HOME/myDefaultCreatoolsGenerationDir
161 echo "Name of the Generation Directory (default is $racine)"
163 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"
251 while [ "$loginUserName" == "" ]
253 echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
255 echo "Login User Name (mandatory!)"
257 echo "you said : [" $loginUserName "]"
263 while [ "$loginGroupName" == "" ]
265 #echo "Have a look at the following line to know 'Login User Name'/'Login Group Name'"
266 #echo "Login Group Name (mandatory!)"
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
366 echo "========================== 1 "
367 source scripts/Check-if-root.sh
368 bash scripts/ThirdParty-install-Base-Stuff.sh
369 bash scripts/ThirdParty-install-VTK.sh
370 bash scripts/ThirdParty-install-gdcm.sh
371 bash scripts/ThirdParty-install-ITK.sh
372 bash scripts/ThirdParty-install.sh
373 bash scripts/ThirdParty-install-Finalize.sh
375 if [ "$sourcesFrom" = "CVS" ]
377 echo "----------------------------------------------------------------------"
379 echo "To go on, run again 'bash menu.sh' as '$loginUserName', in a new window"
380 echo "---------------------------------------------------------------------"
382 echo "----------------------------------------------------------------------"
384 echo "To go on, run again 'bash menu.sh' in a new window"
385 echo "---------------------------------------------------------------------"
388 echo "==> You HAVE to leave current window to continue!"
394 echo "========================== 1.0 "
395 source scripts/Check-if-root.sh
396 bash scripts/ThirdParty-install-Base-Stuff.sh
397 bash scripts/ThirdParty-install-Finalize.sh
401 echo "========================== 1.1 "
402 source scripts/Check-if-root.sh
404 bash scripts/ThirdParty-install-VTK.sh
406 bash scripts/ThirdParty-install-Finalize.sh
411 echo "========================== 1.2 "
412 source scripts/Check-if-root.sh
413 bash scripts/ThirdParty-install-gdcm.sh
414 bash scripts/ThirdParty-install-Finalize.sh
418 echo "========================== 1.3 "
419 source scripts/Check-if-root.sh
420 bash scripts/ThirdParty-install-ITK.sh
421 bash scripts/ThirdParty-install-Finalize.sh
428 bash scripts/CreaTools-load.sh
430 source scripts/CreaTools-configure.sh
431 bash scripts/CreaTools-compile.sh
433 bash scripts/CreaTools-install.sh
434 echo "You HAVE to leave current window to continue!"
440 echo "========================== 2.1"
441 bash scripts/CreaTools-load.sh
445 echo "========================== 2.2"
446 source scripts/CreaTools-configure.sh
448 bash scripts/CreaTools-compile.sh
450 # To allow (*very* aware) user to patch code, later
451 if [ ! -e $generationdir/creatools_source ]
453 echo "You probabely made a mistake : "
454 echo "Directory $loginUserName $generationdir/creatools_source not found"
455 echo "Make sure you know the mistake"
456 echo "Hit any key to continue"
457 echo "Fix the mistake!"
460 chown -R $loginUserName $generationdir/creatools_source
461 chgrp -R $loginGroupName $generationdir/creatools_source
462 # Too much time consuming
463 #chown -R $loginUserName $generationdir/creatools_source
464 #chgrp -R $loginGroupName $generationdir/creatools_source
474 # echo "==================================================="
477 # echo "YOU NEED TO RUN THIS ONE AS root"
478 # echo "==================================================="
484 echo "========================= 4"
486 bash scripts/CreaTools-install.sh
490 # echo "You HAVE to leave current window to continue!"
492 # echo "==> Hit any key to close current window"
498 if [ $expanded = "NO" ]
507 echo "========================= 5"
508 bash scripts/CreaTools-uninstall.sh
510 echo "==> Hit any key to go on"
516 echo "==================================="
519 echo "==> Hit any key to go on"
525 echo "==================================="
527 # WARNING : $installPrefixThird is taken from CreaTools-configure.sh
528 # if user configured without installing third party library,
529 # Last third party library is still in use! JPR
532 if [ ! -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
536 echo "the curently used Third Party libraries are NOT in $installPrefixThird but in :"
537 grep "installPrefixThird=" /etc/bashrc
538 echo "VTK_DIR : " $VTK_DIR
539 echo "ITK_DIR : " $ITK_DIR
540 echo "GDCM_DIR : " $GDCM_DIR
542 echo "installPrefixThird ... " $installPrefixThird
545 if [ -f $installPrefixThird/share/creatools_third_party_library_config.sh ]
547 echo "Third party config file : " $installPrefixThird/share/creatools_third_party_library_config.sh
549 more $installPrefixThird/share/creatools_third_party_library_config.sh
555 if [ -f $installPrefix/share/creatools_base_library_config.sh ]
557 echo "Creatools base library config file : " $installPrefix/share/creatools_base_library_config.sh
559 more $installPrefix/share/creatools_base_library_config.sh
562 echo "installPrefix ... " $installPrefix
565 echo "VTK_DIR : " $VTK_DIR
566 echo "ITK_DIR : " $ITK_DIR
567 echo "GDCM_DIR : " $GDCM_DIR
569 echo "crea_DIR : " $crea_DIR
570 echo "BBTK_DIR : " $BBTK_DIR
571 echo "creaMaracasVisu_DIR : " $creaMaracasVisu_DIR
572 echo "creaEnvironment_DIR : " $creaEnvironment_DIR
573 echo "creaBruker_DIR : " $creaBruker_DIR
574 echo "creaImageIO_DIR : " $creaImageIO_DIR
575 echo "creaContours_DIR : " $creaContours_DIR
576 echo "creaRigidRegistration_DIR :" $creaRigidRegistration_DIR
577 echo "bbtkGEditor_DIR : " $bbtkGEditor_DIR
578 echo "creaTools_DIR : " $creaTools_DIR
579 echo "creaMiniTools_DIR : " $creaMiniTools_DIR
580 echo "Ido_DIR : " $Ido_DIR
581 echo "==================================="
583 echo "Press any key to continue"
593 # Hiden option, usefull at debug time
594 bash scripts/ThirdParty-install_no_compile.sh
601 echo "Your answer must be in {0, 1, 2, 5, 6, 7, 8, 9} (was [ $i ])"
603 echo "Your answer must be in {0, 1, 2.1, 2.2, 2.3, 5, 6, 7, 8, 9} (was [ $i ])"