]> Creatis software - creaToolsTools.git/blobdiff - Install_ThirdParty/scripts/install_thirdparty_all.sh
Modification creaToolsThirdParty scripts EED-JCP
[creaToolsTools.git] / Install_ThirdParty / scripts / install_thirdparty_all.sh
index a63a0b1f371e42f93d9e9f45d4e1d37b8080fa9b..86709106da3b19ac54c4050a678be4abc067ba57 100644 (file)
@@ -1,14 +1,16 @@
 
 #!/bin/sh
 
-if [ $# = 0 ]
-then
-  echo "Use it as :"
-  echo "sh install_thirdparty_fedora.sh <nameOfTheGenerationDirectory> <installPrefix> <buildType>"  
-  echo " "
-  echo "ex : sh install_thirdparty_fedora.sh /tmp/gendir /home/jpr/myInstallDirectory Debug"
-  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 "----------"
@@ -16,21 +18,28 @@ echo $0
 echo $1
 echo $2
 echo $3
+echo $4
 echo "----------"
 
-if [ $# != 3 ]
+
+
+if [ $# = 0 || $# != 4 ]
 then 
   echo "Use it as :"
-  echo "sh install_thirdparty_fedora.sh <nameOfTheGenerationDirectory> <installPrefix> <buildType>"
+  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> " 
   echo " "
-  echo "ex : sh install_thirdparty_fedora.sh /tmp/gendir /home/jpr/myInstallDirectory Debug"
+  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
+OS=$4
 
 scriptDir=$PWD
 sourcesDir=$generationdir/thirdparty_sources
@@ -40,20 +49,69 @@ mkdir $generationdir
 mkdir $sourcesDir
 mkdir $binDir
 
+
+
+
+
 # the following stupid test is used at debug time; Please don't remove!
 if [ true = true ]
 then
-  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
+
+  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
+     ;;
+  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
+     ;;
+  MacOS)
+# QUESTION : is -y  mandatory?
+
+     sudo port install cmake -y 
+     sudo port install cmake-gui -y 
+     sudo port install doxygen -y
+     sudo port install graphviz -y
+     sudo port install texlive -y
+     sudo port install latex2html -y
+     sudo port install wxGTK-devel wxBase -y
+     sudo port install boost-devel -y
+     sudo port install sqlite-devel -y
+     sudo port install qt-devel -y
+     sudo port install mesa-libOSMesa-devel -y
+     ;;
+  *)
+     #echo " '$OS' : Unknown (for us...) Operating Sytem "
+     echo " Allowed values are (right now) Fedora, Ubuntu, MacOS "
+     exit 0
+     ;;
+  esac             
 fi
 
 
@@ -132,4 +190,27 @@ then
   cd ..
 fi
 
+#deal with create creatools_third_party_libraries_config.sh
+
+THIRDPARTY_INSTALL_DIR=$installPrefix/thirdparty_install
+sudo rm        $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
+sudo touch     $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
+sudo chmod 666 $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
+
+sudo echo export PATH=$PATH:$THIRDPARTY_INSTALL_DIR/bin             >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
+sudo echo export VTK_DIR=$THIRDPARTY_INSTALL_DIR/lib/vtk-5.6        >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
+sudo echo export ITK_DIR=$THIRDPARTY_INSTALL_DIR/lib/InsightToolkit >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
+sudo echo export GDCM_DIR=$THIRDPARTY_INSTALL_DIR/lib/gdcm          >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
+sudo echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GDCM_DIR         >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
+sudo echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ITK_DIR          >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
+sudo echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$VTK_DIR          >> $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_library_config.sh
+
+#  modify .bashrc
+# - remove line 'sh $installPrefix/thirdparty_install/share/creatools_third_party_libraries_config.sh' if any (with accurate value for ???)
+sed -i -e 's/.*creatools_third_party_libraries_config.*/  /g' ~/.bashrc
+
+# - add line 'sh $installPrefix/thirdparty_install/share/creatools_third_party_libraries_config.sh' (with accurate value for ???)
+echo sh $THIRDPARTY_INSTALL_DIR/share/creatools_third_party_libraries_config.sh >> ~/.bashrc 
+
+