summaryrefslogtreecommitdiffstats
path: root/Configure.mk
diff options
context:
space:
mode:
authorGravatar Thiago Macieira <thiago@macieira.org>2013-05-14 15:23:39 -0600
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-16 12:26:20 -0700
commit2ba236e288ace9c2c925e0e1bc1a97f9e3c59b46 (patch)
tree0370649f37952b3d979b16a2b7047cc4a140c818 /Configure.mk
parentd39b1aedcd9dedecfca54c91661a81406b80c6ec (diff)
downloadsubsurface-2ba236e288ace9c2c925e0e1bc1a97f9e3c59b46.tar.gz
Search both qmake and qmake-qt4
Some Linux distributions do not ship a "qmake" binary, despite recommendations from the Qt Project. We need to cope with that, so we search for qmake-qt4 if qmake fails. We use "qmake -query QT_VERSION" instead of qmake -v because that is known to produce an error for Qt 3's qmake. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'Configure.mk')
-rw-r--r--Configure.mk16
1 files changed, 13 insertions, 3 deletions
diff --git a/Configure.mk b/Configure.mk
index 96508c65c..f8bd33ed4 100644
--- a/Configure.mk
+++ b/Configure.mk
@@ -5,9 +5,6 @@ all:
PKGCONFIG=pkg-config
XML2CONFIG=xml2-config
XSLCONFIG=xslt-config
-QMAKE=qmake
-MOC=moc
-UIC=uic
CONFIGFILE = config.cache
ifeq ($(CONFIGURING),1)
@@ -70,6 +67,19 @@ endif
# about it if it doesn't.
LIBUSB = $(shell $(PKGCONFIG) --libs libusb-1.0 2> /dev/null)
+# Find qmake. Rules are:
+# - use qmake if it is in $PATH
+# [qmake -query QT_VERSION will fail if it's Qt 3's qmake]
+# - if that fails, try qmake-qt4
+# - if that fails, print an error
+# We specifically do not search for qmake-qt5 since that is not supposed
+# to exist.
+QMAKE = $(shell { qmake -query QT_VERSION >/dev/null 2>&1 && echo qmake; } || \
+ { qmake-qt4 -v >/dev/null 2>&1 && echo qmake-qt4; })
+ifeq ($(strip $(QMAKE)),)
+$(error Could not find qmake or qmake-qt4 in $$PATH or they failed)
+endif
+
# Use qmake to find out which Qt version we are building for.
QT_VERSION_MAJOR = $(shell $(QMAKE) -query QT_VERSION | cut -d. -f1)
ifeq ($(QT_VERSION_MAJOR), 5)