-
Notifications
You must be signed in to change notification settings - Fork 168
/
qmake-auto
executable file
·26 lines (26 loc) · 1.06 KB
/
qmake-auto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/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 ~/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 "$@"