]> Creatis software - cpPlugins.git/blobdiff - third_party_installers/cpPlugins_Install_VTK.sh
...
[cpPlugins.git] / third_party_installers / cpPlugins_Install_VTK.sh
index d5e99585709c8d9198205c3d286b96cd0a046a5a..32297fe2678d061546280c15a25f31a43c6fc306 100755 (executable)
@@ -41,19 +41,19 @@ if [ ! -x $cmake_exec ]; then
     exit 1
 fi
 
-## Locate qmake executable
+# Locate qmake executable
 qmake_locations=("/usr/bin" "/usr/local/bin" "${HOME}/local/bin")
 qmake_exec=""
 for loc in ${qmake_locations[@]}; do
     qmake_file="$loc/qmake"
     if [ -x $qmake_file ]; then
-        str=`$qmake_file --version | grep Using\ Qt\ version`
-        version=`expr substr "$str" 18 3`
-        if [ "$version" == "4.8" ]; then
+        version=`$qmake_file --version | grep Using\ Qt\ version | cut -d ' ' -f 4`
+        if [ "${version:0:3}" == "4.8" ]; then
             qmake_exec=$qmake_file
         fi
     fi
 done
+
 if [ ! -x $qmake_exec ]; then
     echo "$0: modify this script to put the correct location of qmake."
     exit 1