forked from mattanger/ckb-next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qmake-auto
executable file
·28 lines (27 loc) · 1.13 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
27
28
#!/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
export QMAKE_MACOSX_DEPLOYMENT_TARGET=10.10
# 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 /usr/local/opt/qt5/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 "$@"