]> Creatis software - cpPlugins.git/blobdiff - third_party_installers/cpPlugins_Install_ITK.sh
...
[cpPlugins.git] / third_party_installers / cpPlugins_Install_ITK.sh
index d9ca4ff09d149c00ccb0db30774f23428dfbc13e..baf70ebb3239aafeb0c28f02f3ba9df68f8acb86 100755 (executable)
@@ -2,15 +2,23 @@
 
 ## Some configuration variables
 number_of_processes="-j4"
+comp_type=Debug
 
 ## Locate cmake executable
-cmake_exec="/usr/bin/cmake"
-if [ ! -x $cmake_exec ]; then
-    cmake_exec="/usr/local/bin/cmake"
-fi
-if [ ! -x $cmake_exec ]; then
-    cmake_exec="${HOME}/local/bin/cmake"
-fi
+cmake_locations=("/usr/bin" "/usr/local/bin" "${HOME}/local/bin")
+cmake_exec=""
+cmake_ver=""
+for loc in ${cmake_locations[@]}; do
+    cmake_file="$loc/cmake"
+    if [ -x $cmake_file ]; then
+        str=`$cmake_file --version | grep version`
+        version=${str:14}
+        if [ "$cmake_ver" \< "$version" ]; then
+            cmake_ver=$version
+            cmake_exec=$cmake_file
+        fi
+    fi
+done
 if [ ! -x $cmake_exec ]; then
     echo "$0: modify this script to put the correct location of cmake."
     exit 1
@@ -72,7 +80,7 @@ $cmake_exec \
     -DBUILD_EXAMPLES:BOOL=OFF \
     -DBUILD_SHARED_LIBS:BOOL=ON \
     -DBUILD_TESTING:BOOL=OFF \
-    -DCMAKE_BUILD_TYPE:STRING=MinSizeRel \
+    -DCMAKE_BUILD_TYPE:STRING=$comp_type \
     -DModule_ITKReview:BOOL=ON \
     -DModule_ITKVtkGlue:BOOL=OFF \
     -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/local \