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
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
fi
## Locate qmake executable
-qmake_dirs=("/usr/bin" "/usr/local/bin" "${HOME}/local/bin")
+qmake_locations=("/usr/bin" "/usr/local/bin" "${HOME}/local/bin")
qmake_exec=""
-for dir in ${qmake_dirs[@]}; do
- echo $dir
+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
+ qmake_exec=$qmake_file
+ fi
+ fi
done
-
-
-# qmake_exec="/usr/bin/qmake"
-# number="0"
-# if [ -x $qmake_exec ]; then
-# version=`$qmake_exec --version | grep Using\ Qt\ version`
-# number=`expr substr "$version" 18 1`
-# else
-# qmake_exec=""
-# fi
-# if [ "$number" -ne "4" ]; then
-# qmake_exec=""
-# fi
-# echo 1$qmake_exec
-
-# if [ "x$qmake_exec" != "x" ]; then
-# qmake_exec="/usr/local/bin/qmake"
-# if [ ! -x $qmake_exec ]; then
-# number="0"
-# if [ -x $qmake_exec ]; then
-# version=`$qmake_exec --version | grep Using\ Qt\ version`
-# number=`expr substr "$version" 18 1`
-# fi
-# if [ "$number" -ne "4" ]; then
-# qmake_exec=""
-# fi
-# else
-# qmake_exec=""
-# fi
-# else
-# qmake_exec=""
-# fi
-# if [ "x$qmake_exec" != "x" ]; then
-# qmake_exec="${HOME}/local/bin/qmake"
-# if [ ! -x $qmake_exec ]; then
-# number="0"
-# if [ -x $qmake_exec ]; then
-# version=`$qmake_exec --version | grep Using\ Qt\ version`
-# number=`expr substr "$version" 18 1`
-# fi
-# echo $number
-# if [ "$number" -ne "4" ]; then
-# qmake_exec=""
-# fi
-# else
-# qmake_exec=""
-# fi
-# else
-# qmake_exec=""
-# fi
-# if [ ! -x $qmake_exec ]; then
-# echo "$0: modify this script to put the correct location of qmake."
-# exit 1
-# fi
-# echo $qmake_exec
-
-exit 1
+if [ ! -x $qmake_exec ]; then
+ echo "$0: modify this script to put the correct location of qmake."
+ exit 1
+fi
## Check input parameters and process inputs (if needed)
if [ "$#" -eq 1 ]; then