- if test x$passed == xno; then
- passed=yes
- PKG_CHECK_MODULES(QT, qt-mt >= 3.3,[],
- [passed=no;AC_MSG_RESULT([gr-qtgui requires qt, not found. Checking for qt-mt])])
+ if test $passed = yes; then
+ dnl Check for package qt or qt-mt, set QT_CFLAGS and QT_LIBS
+ PKG_CHECK_MODULES(QTCORE, QtCore >= 4.2, [],
+ [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtCore >= 4.2.])])
+ PKG_CHECK_MODULES(QTGUI, QtGui >= 4.2, [],
+ [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtGui >= 4.2.])])
+ PKG_CHECK_MODULES(QTOPENGL, QtOpenGL >= 4.2, [],
+ [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtOpenGL >- 4.2.])])
+
+ dnl Fetch QWT variables
+ GR_QWT([], [passed=no])
+
+ dnl Export the include dirs and libraries (note: QTOPENGL_LIBS includes links
+ dnl to QtCore and QtGui libraries)
+ QT_INCLUDES="$QWT_CFLAGS $QTCORE_CFLAGS $QTGUI_CFLAGS"
+ QT_LIBS="$QWT_LIBS $QTOPENGL_LIBS"
+
+ dnl Build an includes variable specifically for running qmake by extracting
+ dnl all includes from the QWT, without the -I;
+ dnl qmake appends the -I when processing the project file INCLUDEPATH
+ for i in $QWT_CFLAGS; do
+ QMAKE_INCLUDES="$QMAKE_INCLUDES ${i##-I}"
+ done
+
+ QT_MOC_EXEC=`pkg-config --variable=moc_location QtCore`
+ QT_UIC_EXEC=`pkg-config --variable=uic_location QtCore`
+
+ AC_SUBST(QMAKE_INCLUDES)
+ AC_SUBST(QT_INCLUDES)
+ AC_SUBST(QT_LIBS)
+ AC_SUBST(QT_MOC_EXEC)
+ AC_SUBST(QT_UIC_EXEC)