[PATCH 2/2] Get the name of moc,uic,rcc from the .pc files in Qt 4

Thiago Macieira thiago at macieira.org
Tue May 14 14:23:40 PDT 2013


Just in case some crazy distributions also rename the binaries.

Renaming the binaries is not supported in Qt 5 and should never be
done. Besides, the binary names are missing from Qt 5.0.

Signed-off-by: Thiago Macieira <thiago at macieira.org>
---
 Configure.mk | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Configure.mk b/Configure.mk
index f8bd33e..a08a554 100644
--- a/Configure.mk
+++ b/Configure.mk
@@ -86,10 +86,16 @@ ifeq ($(QT_VERSION_MAJOR), 5)
 	QT_MODULES = Qt5Widgets Qt5Svg
 	QT_CORE = Qt5Core
 	QTBINDIR = $(shell $(QMAKE) -query QT_HOST_BINS)
+	# Tool paths are not stored in .pc files in Qt 5.0
+	MOC = $(QTBINDIR)/moc
+	UIC = $(QTBINDIR)/uic
+	RCC = $(QTBINDIR)/rcc
 else
 	QT_MODULES = QtGui QtSvg
 	QT_CORE = QtCore
-	QTBINDIR = $(shell $(QMAKE) -query QT_INSTALL_BINS)
+	MOC = $(shell $(PKGCONFIG) --variable=moc_location QtCore)
+	UIC = $(shell $(PKGCONFIG) --variable=uic_location QtGui)
+	RCC = $(shell $(PKGCONFIG) --variable=rcc_location QtGui)
 endif
 
 # we need GLIB2CFLAGS for gettext
@@ -98,9 +104,6 @@ LIBQT = $(shell $(PKGCONFIG) --libs $(QT_MODULES))
 ifneq ($(filter reduce_relocations, $(shell $(PKGCONFIG) --variable qt_config $(QT_CORE))), )
 	QTCXXFLAGS += -fPIE
 endif
-MOC = $(QTBINDIR)/moc
-UIC = $(QTBINDIR)/uic
-RCC = $(QTBINDIR)/rcc
 
 LIBGTK = $(shell $(PKGCONFIG) --libs gtk+-2.0 glib-2.0)
 ifneq (,$(filter $(UNAME),linux kfreebsd gnu))
-- 
1.7.11.7



More information about the subsurface mailing list