]> Creatis software - creaToolsTools.git/blobdiff - Linux/scripts/ThirdParty-install.sh
more checking
[creaToolsTools.git] / Linux / scripts / ThirdParty-install.sh
index 54121053283e73a0428620591623df37ceb13de2..3f866ad7067a70a4815952e5b72e270b47b3b5d9 100644 (file)
@@ -1,39 +1,60 @@
 #!/bin/sh
+ if [ ! -f $PWD/scripts/CreaTools-configure.sh ]
+ then 
+   echo
+   echo "..ERROR.."
+   echo "==================================================="
+   echo "REMEMBER !"
+   echo ""
+   echo "YOU NEED TO RUN 'Configure' (0) First !"
+   echo "==================================================="
+   echo
+   echo
+   exit 0
+fi 
 
 source $PWD/scripts/CreaTools-configure.sh
 
-echo "------"
-echo $PWD/scripts/CreaTools-configure.sh
-echo generationdir
-echo $generationdir
-echo docgeneration
-echo $docgeneration
-echo installPrefix
-echo $installPrefix
-echo buildType
-echo $buildType
-echo gdcmVersion
-echo $gdcmVersion
-echo sourcesFrom
-echo $sourcesFrom
-echo scriptDir
-echo $scriptDir
-echo start_point
-echo $start_point
-echo "------"
+   echo "------"
+   echo $PWD/scripts/CreaTools-configure.sh
+   echo --generationdir--
+   echo $generationdir
+   echo --docgeneration--
+   echo $docgeneration
+   echo --installPrefix--
+   echo $installPrefix
+   echo --buildType--
+   echo $buildType
+   echo --gdcmVersion--
+   echo $gdcmVersion
+   echo --sourcesFrom--
+   echo $sourcesFrom
+#   echo --scriptDir--
+#   echo $scriptDir
+#   echo --start_point--
+#   echo $start_point
+   echo "------"
+
 
 scriptDir=$PWD
 sourcesDir=$generationdir/thirdparty_sources
 binDir=$generationdir/thirdparty_bin
 
-mkdir $generationdir
-mkdir $sourcesDir
-mkdir $binDir
+if [ ! -e $generationdir ]
+then
+   mkdir $generationdir
+   mkdir $sourcesDir
+   mkdir $binDir
+fi
 
-rm $installPrefix/share/creatools_third_party_library_config.sh
+if [ -f $installPrefix/share/creatools_third_party_library_config.sh ]
+then
+   rm $installPrefix/share/creatools_third_party_library_config.sh
+fi
 
 # the following stupid test is used at debug time; Please don't remove!
 if [ true = true ]
+#if [ true = false ]
 then
 
   case "$OperatingSystem" in
@@ -97,6 +118,7 @@ fi
 
 
 # the following stupid test is used at debug time; Please don't remove!
+#if [ true = false ]
 if [ true = true ]
 then
   rm -rf $sourcesDir/VTK*
@@ -116,12 +138,11 @@ then
 fi
 
 
-
 if [ $buildType = "Debug" ]
 then
-debug="ON"
+   debug="ON"
 else
-debug="OFF"
+   debug="OFF"
 fi
 
 
@@ -130,8 +151,9 @@ then
   libname=VTK
   dirInstall=$binDir/$libname-Bin
   dirInstallVTK=$dirInstall
-  VTK_DIR=$installPrefix/lib/vtk-5.6/
+  export VTK_DIR=$installPrefix/lib/vtk-5.6/
   cd $dirInstall
   cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
   ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
   cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefix CMakeCache.txt
@@ -145,7 +167,7 @@ if [ true = true ]
 then
   libname=gdcm
   dirInstall=$binDir/$libname-Bin
-  GDCM_DIR=$installPrefix/lib/gdcm/
+  export GDCM_DIR=$installPrefix/lib/gdcm/
   mkdir $dirInstall
   cd $dirInstall
   cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
@@ -162,7 +184,7 @@ if [ true = true ]
 then
   libname=InsightToolkit-3.20.0
   dirInstall=$binDir/$libname-Bin
-  ITK_DIR=$installPrefix/lib/InsightToolkit/
+  export ITK_DIR=$installPrefix/lib/InsightToolkit/
   mkdir $dirInstall
   cd $dirInstall
   cmake -G"Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
@@ -202,5 +224,3 @@ sed -i -e '/.*creatools_third_party_library_config.*/ d' /etc/bashrc
 
 # - add line 'sh $installPrefix/share/creatools_third_party_library_config.sh' (with accurate value for ???)
 echo source $installPrefix/share/creatools_third_party_library_config.sh >> /etc/bashrc 
-
-