Files
ckb-next/qmake-auto
T
Ethan Richardson fc31ac2648 Add brew installed qt5 path to qmake-auto script
This will search through the qt install directory created when `brew install qt5` has been run.
2016-05-01 01:03:18 -05:00

27 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
function die {
echo "No suitable qmake found."
echo "Please make sure you have Qt5 installed."
echo "Re-run this program with QMAKE=/path/to/qmake to select qmake manually."
exit 1
}
if [[ "$QMAKE" != "" ]]; then
$QMAKE "$@"
exit $?
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
# OSX: Look for qmake in standard install locations
QMAKE=`find /usr/local/opt/qt5/bin ~/Qt/*/clang_64/bin ~/Qt5*/*/clang_64/bin ~/Applications/Qt/*/clang_64/bin ~/Applications/Qt5*/*/clang_64/bin /Applications/Qt/*/clang_64/bin /Applications/Qt5*/*/clang_64/bin -name qmake -print -quit 2>/dev/null`
[[ $QMAKE == "" ]] && die
else
# Linux: Look for system-installed Qt5
QMAKE=`which qmake-qt5 2>/dev/null`
[[ $? -ne 0 ]] && QMAKE=`which qmake 2>/dev/null`
# If not found, look in standard locations
if [[ `$QMAKE -v 2>/dev/null | grep -i "Qt version 5" | wc -l` -ne 1 ]]; then
QMAKE=`find /usr/lib/*/qt5/bin ~/Qt/*/gcc_64/bin -name qmake -print -quit 2>/dev/null`
fi
fi
[[ `$QMAKE -v 2>/dev/null | grep -i "Qt version 5" | wc -l` -ne 1 ]] && die
$QMAKE "$@"