]> Creatis software - creaToolsTools.git/blobdiff - Install_ThirdParty/scripts/install_thirdparty_all.sh
*** empty log message ***
[creaToolsTools.git] / Install_ThirdParty / scripts / install_thirdparty_all.sh
index a1537fd8abdfbc19e971d26864982805adba13bb..6375e1d84f4a7e8bb2645a18fd7234fb03eaac0f 100644 (file)
@@ -1,15 +1,16 @@
 
 #!/bin/sh
 
-if [ $# = 0 ]
-then
-  echo "Use it as :"
-  echo "sh install_thirdparty_all.sh <nameOfTheGenerationDirectory> <installPrefix> <buildType> <OperatingSystem>"
-  echo "with 'OperatingSystem' in {Fedora, Ubuntu, MacOS}" 
-  echo " "
-  echo "ex : sh install_thirdparty_all.sh /tmp/gendir ~/Creatis/myInstallDirectory Debug Ubuntu"
-  exit 0
-fi
+#if [ $# = 0 ]
+#then
+#  echo "Use it as :"
+#  echo "sh install_thirdparty_all.sh <nameOfTheGenerationDirectory> <installPrefix> <buildType> <OperatingSystem>"
+#  echo "with 'OperatingSystem' in {Fedora, Ubuntu, MacOS}" 
+#  echo "with 'installPrefix' : /usr/local or <directory where you want to install>/thirdparty_install
+#  echo " "
+#  echo "ex : sh install_thirdparty_all.sh /tmp/gendir  /tmp/gendir/thirdparty_install Debug Ubuntu"
+#  exit 0
+#fi
 
 echo $#
 echo "----------"
@@ -20,17 +21,21 @@ echo $3
 echo $4
 echo "----------"
 
-if [ $# != 4 ]
+
+
+if [ $# = 0 || $# != 4 ]
 then 
   echo "Use it as :"
   echo "sh install_thirdparty_all.sh <nameOfTheGenerationDirectory> <installPrefix> <buildType> <OperatingSystem>"
-  echo "with 'OperatingSystem' in {Fedora, Ubuntu, MacOS}" 
+  echo "with 'OperatingSystem' in {Fedora, Ubuntu, MacOS}"
+  echo "with 'installPrefix' : /usr/local or <directory where you want to install> " 
   echo " "
-  echo "ex : sh install_thirdparty_all.sh /tmp/gendir ~/Creatis/myInstallDirectory Debug Ubuntu"
+  echo "ex : sh install_thirdparty_all.sh /tmp/gendir /tmp/gendir/thirdparty_install Debug Ubuntu"
   exit 0
 fi
 
-
+echo $OS 
+echo 'ididid'
 generationdir=$1
 installPrefix=$2
 buildType=$3
@@ -40,54 +45,72 @@ scriptDir=$PWD
 sourcesDir=$generationdir/thirdparty_sources
 binDir=$generationdir/thirdparty_bin
 
+
 mkdir $generationdir
 mkdir $sourcesDir
 mkdir $binDir
 
+sudo rm        $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
+
+
+
+
 # the following stupid test is used at debug time; Please don't remove!
 if [ true = true ]
 then
 
-  case $OS in
+  case "$OS" in
   Fedora)
-     sudo yum install cmake -y 
-     sudo yum install cmake-gui -y 
-     sudo yum install doxygen -y
-     sudo yum install graphviz -y
-     sudo yum install texlive -y
-     sudo yum install latex2html -y
-     sudo yum install wxGTK-devel wxBase -y
-     sudo yum install boost-devel -y
-     sudo yum install sqlite-devel -y
-     sudo yum install qt-devel -y
-     sudo yum install mesa-libOSMesa-devel -y
+     yum install cmake -y 
+     yum install cmake-gui -y 
+     yum install doxygen -y
+     yum install graphviz -y
+     yum install texlive -y
+     yum install latex2html -y
+     yum install wxGTK-devel wxBase -y
+     yum install boost-devel -y
+     yum install sqlite-devel -y
+     yum install qt-devel -y
+     yum install mesa-libOSMesa-devel -y
      ;;
   Ubuntu)  
-     sudo apt-get --yes install build-essential  # esta linea instala las librerias necesarias para compilar en ubuntu, g++ gcc etc etc etc.
-     sudo apt-get --yes install cmake
-     sudo apt-get --yes install cmake-gui
-     sudo apt-get --yes install cmake-curses-gui
-     sudo apt-get --yes install doxygen
-     sudo apt-get --yes install graphviz
-     sudo apt-get --yes install texlive
-     sudo apt-get --yes install latex2html
-     sudo apt-get --yes install libgtk2.0-dev #GTK
-     sudo apt-get --yes install libwxgtk2.8-dev #Wx GTK
-     sudo apt-get --yes install libwxbase2.8-dev #Wx solito
-     sudo apt-get --yes install libboost-dev  #Boost
-     sudo apt-get --yes install libboost-all-dev #Boost
-     sudo apt-get --yes install libqt4-dev #QT4
-     sudo apt-get --yes install sqlite
-     sudo apt-get --yes install libosmesa6-dev #Mesa6
-     sudo apt-get --yes install uuid-dev # uuid para la instalacion de itk
-     sudo apt-get --yes install libxaw7-dev # X11
+     apt-get --yes install build-essential  # esta linea instala las librerias necesarias para compilar en ubuntu, g++ gcc etc etc etc.
+     apt-get --yes install cmake
+     apt-get --yes install cmake-gui
+     apt-get --yes install cmake-curses-gui
+     apt-get --yes install doxygen
+     apt-get --yes install graphviz
+     apt-get --yes install texlive
+     apt-get --yes install latex2html
+     apt-get --yes install libgtk2.0-dev #GTK
+     apt-get --yes install libwxgtk2.8-dev #Wx GTK
+     apt-get --yes install libwxbase2.8-dev #Wx solito
+     apt-get --yes install libboost-dev  #Boost
+     apt-get --yes install libboost-all-dev #Boost
+     apt-get --yes install libqt4-dev #QT4
+     apt-get --yes install sqlite
+     apt-get --yes install libsqlite0-dev
+     apt-get --yes install libosmesa6-dev #Mesa6
+     apt-get --yes install uuid-dev # uuid para la instalacion de itk
+     apt-get --yes install libxaw7-dev # X11
      ;;
   MacOS)
-     echo "MacOS not yet dealt with ..."
-     exit 0
+# QUESTION : is -y  mandatory?
+
+     port install cmake -y 
+     port install cmake-gui -y 
+     port install doxygen -y
+     port install graphviz -y
+     port install texlive -y
+     port install latex2html -y
+     port install wxGTK-devel wxBase -y
+     port install boost-devel -y
+     port install sqlite-devel -y
+     port install qt-devel -y
+     port install mesa-libOSMesa-devel -y
      ;;
   *)
-     echo " '$OS' : Unknown (for us...) Operating Sytem "
+     #echo " '$OS' : Unknown (for us...) Operating Sytem "
      echo " Allowed values are (right now) Fedora, Ubuntu, MacOS "
      exit 0
      ;;
@@ -170,4 +193,24 @@ then
   cd ..
 fi
 
+#deal with create creatools_third_party_libraries_config.sh
+
+touch     $installPrefix/share/creatools_third_party_library_config.sh
+chmod 666 $installPrefix/share/creatools_third_party_library_config.sh
+
+echo export PATH='$'PATH:$installPrefix/bin                    >> $installPrefix/share/creatools_third_party_library_config.sh
+echo export VTK_DIR=$installPrefix/lib/vtk-5.6                 >> $installPrefix/share/creatools_third_party_library_config.sh
+echo export ITK_DIR=$installPrefix/lib/InsightToolkit          >> $installPrefix/share/creatools_third_party_library_config.sh
+echo export GDCM_DIR=$installPrefix/lib/gdcm                   >> $installPrefix/share/creatools_third_party_library_config.sh
+echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$GDCM_DIR       >> $installPrefix/share/creatools_third_party_library_config.sh
+echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$ITK_DIR        >> $installPrefix/share/creatools_third_party_library_config.sh
+echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$VTK_DIR        >> $installPrefix/share/creatools_third_party_library_config.sh
+
+#  modify .bashrc
+# - remove line 'sh $installPrefix/share/creatools_third_party_library_config.sh' if any (with accurate value for ???)
+sed -i -e '/.*creatools_third_party_library_config.*/ d' ~/.bashrc
+
+# - add line 'sh $installPrefix/share/creatools_third_party_library_config.sh' (with accurate value for ???)
+source $installPrefix/share/creatools_third_party_library_config.sh >> ~/.bashrc 
+