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