]> Creatis software - creaToolsTools.git/commitdiff
Allow user to choose ITK3 / ITK4
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 27 Jul 2011 08:54:18 +0000 (08:54 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 27 Jul 2011 08:54:18 +0000 (08:54 +0000)
Linux/scripts/CreaTools-compile.sh
Linux/scripts/ThirdParty-install-ITK.sh
Linux/scripts/ThirdParty-install_no_compile.sh

index 9fbe55b5c67688f37d2f3c8c941340098cfd5f73..52613a67d1074905d08e87cd9faa68227491c09d 100644 (file)
@@ -120,7 +120,7 @@ fi
 creadll=$generationdir/creatools_bin/creaBin
 if [ $OperatingSystem = "MacOS" ]
 then
-   #duplicate form creaTools_name.sh?? //FCY
+    #duplicate form creaTools_name.sh?? //FCY
     DYLD_LIBRARY_PATH=$creadll:$DYLD_LIBRARY_$PATH 
 else
     LD_LIBRARY_PATH=$creadll:$LD_LIBRARY_$PATH
@@ -176,7 +176,7 @@ fi
 if [ $OperatingSystem = "MacOS" ]
 then
     #duplicate form creaTools_name.sh?? //FCY
-    DYLD_LIBRARY_PATH=$creamaracasdll:$DYLD_LIBRARY_$PATH 
+    DYLD_LIBRARY_PATH=$creamaracasdll:$DYLD_LIBRARY_$PATH
 else
     LD_LIBRARY_PATH=$creamaracasdll:$LD_LIBRARY_$PATH
 fi 
@@ -259,7 +259,7 @@ creaimagedll=$generationdir/creatools_bin/creaimageBin
  
 if [ $OperatingSystem = "MacOS" ]
 then
-#duplicate form creaTools_name.sh?? //FCY
+    #duplicate form creaTools_name.sh?? //FCY
     DYLD_LIBRARY_PATH=$creaimagedll:$DYLD_LIBRARY_$PATH 
 else
     LD_LIBRARY_PATH=$creaimagedll:$LD_LIBRARY_$PATH
index d4ef1474665ea22941dcea07a8a68e862d265b13..dcc579d8d8d75e9a42aa1c78dfce4bcbfb03d380 100644 (file)
@@ -73,21 +73,39 @@ then
 fi
 
   echo "we remove old stuff"
-  rm -rf $sourcesDir/InsightToolkit*
-  rm -rf $binDir/InsightToolkit*
-
+  if [ $ITKVersion = ITK3 ]
+  then
+     rm -rf $sourcesDir/InsightToolkit*
+     rm -rf $binDir/InsightToolkit*
+  else
+     rm -rf $sourcesDir/ITK*
+     rm -rf $binDir/ITKt*
+  fi
   cd $sourcesDir
 
  echo "we download new stuff"
- if [ $OperatingSystem = "MacOS" ]
- then
-  curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
-  # MacOS, clever enough to understand it *has* to uncompress, doesn't understand tar -z :-(
-  tar -xvf InsightToolkit-3.20.0.tar.gz
- else
-  wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
-  tar -xzvf InsightToolkit-3.20.0.tar.gz
- fi
+  if [ $ITKVersion = ITK3 ]
+  then
+  #  deal with ITK3
+     if [ $OperatingSystem = "MacOS" ]
+     then
+        curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
+     else
+        wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/InsightToolkit-3.20.0.tar.gz
+     fi
+     tar -xzvf InsightToolkit-3.20.0.tar.gz
+  else
+    #  deal with ITK4
+    if [ $OperatingSystem = "MacOS" ]
+    then
+       curl -O http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/ITK4.0.tgz
+    else
+       wget http://www.creatis.insa-lyon.fr/software/public/creatools/crea_ThirdParty_Libraries/source/ITK4.0.tgz
+    fi
+    tar -xzvf ITK4.0.tgz
+  fi
+
+#fi # JPR ------------1
 
 if [ $buildType = "Debug" ]
 then
@@ -100,7 +118,13 @@ fi
 #if [ true = false ]
 if [ true = true ]
 then
-  libname=InsightToolkit-3.20.0
+  if [ $ITKVersion = ITK3 ]
+  then
+     libname=InsightToolkit-3.20.0
+  else
+     libname=ITK
+  fi
+
   dirInstall=$binDir/$libname-Bin
   export ITK_DIR=$installPrefixThird/lib/InsightToolkit/
   mkdir $dirInstall
@@ -110,6 +134,10 @@ then
   ##cmake -G"CodeBlocks - Unix Makefiles" -H$sourcesDir/$libname -B$dirInstall/
   cmake -D USE_DEBUG_LIB:BOOL=$buildType -D CMAKE_INSTALL_PREFIX:PATH=$installPrefixThird CMakeCache.txt
   cmake -D BUILD_EXAMPLES:BOOL=OFF -D BUILD_TESTING:BOOL=OFF -D BUILD_SHARED_LIBS:BOOL=ON -D ITK_USE_REVIEW:BOOL=ON CMakeCache.txt
+  if [ $ITKVersion = ITK4 ]
+  then
+     cmake -D ITKV3_COMPATIBILITY:BOOL=ON -D ITKGroup_Nonunit:BOOL=ON -D  ITKGroup_IO:BOOL=ON  -D Module_ITK-Deprecated:BOOL=ON -D Module_ITK-Review:BOOL=ON  CMakeCache.txt        
+  fi
   #uncomment following line if you want to use the bleeding edge of GDCM2!
   #cmake -D ITK_USE_SYSTEM_GDCM:BOOL=ON CMakeCache.txt
   cmake CMakeCache.txt
index d0e2d8d02057dbe1d18a8737635b7ac5a8f82840..01c4636fa1d536e45c1fa3f1092e86e5310f3a06 100644 (file)
@@ -60,9 +60,15 @@ chmod 755 $installPrefixThird/share/creatools_third_party_library_config.sh
 
 echo export PATH='$'PATH:$installPrefixThird/bin           >> $installPrefixThird/share/creatools_third_party_library_config.sh
 echo export VTK_DIR=$installPrefixThird/lib/vtk-5.6        >> $installPrefixThird/share/creatools_third_party_library_config.sh
-echo export ITK_DIR=$installPrefixThird/lib/InsightToolkit >> $installPrefixThird/share/creatools_third_party_library_config.sh
+if [ $ITKVersion = ITK3 ]
+then
+   echo export ITK_DIR=$installPrefixThird/lib/InsightToolkit >> $installPrefixThird/share/creatools_third_party_library_config.sh
+else
+   echo export ITK_DIR=$installPrefixThird/lib/               >> $installPrefixThird/share/creatools_third_party_library_config.sh
+fi
 echo export GDCM_DIR=$installPrefixThird/lib/gdcm          >> $installPrefixThird/share/creatools_third_party_library_config.sh
 echo export TTH=$installPrefixThird/bin/tth                >> $installPrefixThird/share/creatools_third_party_library_config.sh
+
 if [ $OperatingSystem = "MacOS" ]
 then
    echo export DYLD_LIBRARY_PATH='$'DYLD_LIBRARY_PATH:$GDCM_DIR   >> $installPrefixThird/share/creatools_third_party_library_config.sh
@@ -74,6 +80,17 @@ else
    echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$VTK_DIR    >> $installPrefixThird/share/creatools_third_party_library_config.sh
 fi
 
+export VTK_DIR=$installPrefixThird/lib/vtk-5.6
+if [ $ITKVersion = ITK3 ]
+then
+   export ITK_DIR=$installPrefixThird/lib/InsightToolkit
+else
+   export ITK_DIR=$installPrefixThird/lib/
+fi
+
+export GDCM_DIR=$installPrefixThird/lib/gdcm
+export TTH=$installPrefixThird/bin/tth
+
    sed -i -e '/.*installPrefixThird*/ d' $ETC_BASHRC
    sed -i -e '/.*creatools_third_party_library_config.*/ d' $ETC_BASHRC