+# 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
+ 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
+ qt_options="--qt-gui --qt-qmake=$qmake_exec"
+else
+ qt_options="--no-qt-gui"
+fi
+