configure: try harder to find the right Qt5 build tools
authorTim-Philipp Müller <tim@centricular.com>
Fri, 10 Jul 2015 18:05:41 +0000 (19:05 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 10 Jul 2015 18:07:42 +0000 (19:07 +0100)
First check for Qt build tools in the host_bins directory
from the Qt5Core pkg-config file. This fixes the situation
where both Qt4 and Qt5 are installed but the global moc/uic/etc.
are the Qt4 version, which would result in build failures.

configure.ac

index ce6f572..2cb967b 100644 (file)
@@ -2606,9 +2606,11 @@ dnl *** Qt ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_QT, true)
 AG_GST_CHECK_FEATURE(QT, [Qt elements], qt, [
   PKG_CHECK_MODULES(QT, Qt5Core Qt5Gui Qt5Quick, [
-      AC_CHECK_PROGS(MOC, [moc-qt5 moc])
-      AC_CHECK_PROGS(UIC, [uic-qt5 uic])
-      AC_CHECK_PROGS(RCC, [rcc])
+      QT_PATH=`$PKG_CONFIG --variable=exec_prefix Qt5Core`
+      QT_HOST_PATH=`$PKG_CONFIG --variable=host_bins Qt5Core`
+      AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
+      AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
+      AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
       if test "x$MOC" = "x" || test "x$UIC" = "x" || test "x$RCC" = "x"; then
         AC_MSG_WARN([One of the required qt build programs was not found])
         HAVE_QT="no"