From 2ba236e288ace9c2c925e0e1bc1a97f9e3c59b46 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 14 May 2013 15:23:39 -0600 Subject: 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 Signed-off-by: Dirk Hohndel --- Configure.mk | 16 +++++++++++++--- 1 file 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) -- cgit v1.2.3-70-g09d2