summaryrefslogtreecommitdiffstats
path: root/scripts/build.sh
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-17 22:03:15 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-17 22:03:15 -0800
commit26f03be236ca7db89d27369173ca182c17bef7fc (patch)
tree4ad81f6672410a25f190dc00b6f9e99690df60f0 /scripts/build.sh
parent74fad4a7cecf57e87a721941b5962a7bcba21b42 (diff)
downloadsubsurface-26f03be236ca7db89d27369173ca182c17bef7fc.tar.gz
build.sh: figure out whether to use qmake or qmake-qt5
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'scripts/build.sh')
-rwxr-xr-xscripts/build.sh17
1 files changed, 16 insertions, 1 deletions
diff --git a/scripts/build.sh b/scripts/build.sh
index 44cf5d52e..14f235a29 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -18,6 +18,21 @@ if [[ ! -d "subsurface" ]] ; then
echo "please start this script from the directory containing the Subsurface source directory"
exit 1
fi
+
+# qmake or qmake-qt5 ?
+qmake -v | grep "version 5" > /dev/null 2>&1
+if [[ $? -eq 0 ]] ; then
+ QMAKE=qmake
+else
+ qmake-qt5 -v | grep "version 5" > /dev/null 2>&1
+ if [[ $? -eq 0 ]] ; then
+ QMAKE=qmake-qt5
+ else
+ echo "can't find a working qmake for Qt5"
+ exit 1
+ fi
+fi
+
mkdir -p install
# build libgit2
@@ -82,6 +97,6 @@ make -j4
make install
cd $SRC/subsurface
-qmake-qt5 LIBDCDEVEL=1 LIBMARBLEDEVEL=$SRC/install SPECIAL_MARBLE_PREFIX=1 LIBGIT2DEVEL=$SRC/libgit2 subsurface.pro
+$QMAKE LIBDCDEVEL=1 LIBMARBLEDEVEL=$SRC/install SPECIAL_MARBLE_PREFIX=1 LIBGIT2DEVEL=$SRC/libgit2 subsurface.pro
make -j4