GNOME Bugzilla – Bug 691583
Qt isn't being seen by configure.ac
Last modified: 2013-05-14 19:50:29 UTC
Qt isn't being seen by the configure.ac script because it looks for a Qt.pc file. As of Qt-4.8.2, Qt doesn't install a Qt.pc file. At least on my machine using Qt's git repository. {QtCore, QtDBus, QtNetwork}.pc files ARE present.
*** Bug 691584 has been marked as a duplicate of this bug. ***
A patch from someone interested in Qt/NetworkManager integration would be most welcome.
Should be simple: -PKG_CHECK_MODULES(QT, [Qt >= 4 QtCore QtDBus QtNetwork], [have_qt=yes],[have_qt=no]) +PKG_CHECK_MODULES(QT, [QtCore >= 4 QtDBus QtNetwork], [have_qt=yes],[have_qt=no]) Would that work? I really don't know much about Qt.
/usr/lib64/pkgconfig/Qt.pc gets installed on Fedora by: qt-devel-4.8.4-17.fc18.x86_64 I also am not too familiar with the setup that Qt development may require, so this may be a Fedora-specific addition to allow parallel install of both qt3 and qt4. NM uses Qt.pc to check for the Qt4 bin dir, via: configure.ac: QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir` configure.ac: AC_CHECK_PROGS(MOC, [moc-qt4 moc],, [$QT4_BINDIR:$PATH]) and then used to determine the path of 'moc'. If we only want to use QtCore, then we need to handle that too, with something like: diff --git a/configure.ac b/configure.ac index 19f9278..2a5a872 100644 --- a/configure.ac +++ b/configure.ac @@ -229,7 +229,7 @@ AC_SUBST(GUDEV_LIBS) GOBJECT_INTROSPECTION_CHECK([0.9.6]) # Qt4 -PKG_CHECK_MODULES(QT, [Qt >= 4 QtCore QtDBus QtNetwork], [have_qt=yes],[have_qt=no]) +PKG_CHECK_MODULES(QT, [QtCore >= 4 QtDBus QtNetwork], [have_qt=yes],[have_qt=no]) AC_ARG_ENABLE(qt, AS_HELP_STRING([--enable-qt], [enable Qt examples]), [enable_qt=${enableval}], [enable_qt=${have_qt}]) if (test "${enable_qt}" = "yes"); then @@ -239,7 +239,7 @@ if (test "${enable_qt}" = "yes"); then AC_SUBST(QT_CFLAGS) AC_SUBST(QT_LIBS) # Check for moc-qt4 and if not found then moc - QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir` + QT4_BINDIR=`$PKG_CONFIG QtCore --variable moc_location` AC_CHECK_PROGS(MOC, [moc-qt4 moc],, [$QT4_BINDIR:$PATH]) fi AM_CONDITIONAL(WITH_QT, test "${enable_qt}" = "yes")
Qt.pc is not part of upstream Qt but an Fedora-specific addition, i'm not sure if this file is included in other distribution. To make it working in other distribution i recommend to use QtCore to check Qt for example: MOC=`pkg-config QtCore --variable=moc_location` The above patch looks fine. Than
Ok, pushed my patch from comment 4.