[poppler] configure.ac qt4/demos qt4/src qt4/tests

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Jun 8 14:49:01 PDT 2008


 configure.ac          |   20 ++++++++++++++++++++
 qt4/demos/Makefile.am |    2 +-
 qt4/src/Makefile.am   |    2 +-
 qt4/tests/Makefile.am |    2 +-
 4 files changed, 23 insertions(+), 3 deletions(-)

New commits:
commit 6f40ee4af6b59f9d2c326adc8d2574e45f4d4d29
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Jun 8 23:46:04 2008 +0200

    Make sure we use Qt4 moc to generate moc files of the qt4 frontend

diff --git a/configure.ac b/configure.ac
index 0c97f30..dccba6e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -296,6 +296,26 @@ fi
 AC_SUBST(POPPLER_QT4_CXXFLAGS)
 AC_SUBST(POPPLER_QT4_LIBS)
 
+if test x$enable_poppler_qt4 = xyes; then
+  AC_MSG_CHECKING([for Qt4 moc])
+  MOCQT4=`which moc`
+  mocversion=`$MOCQT4 -v 2>&1`
+  mocversiongrep=`echo $mocversion | grep "Qt 4"`
+  if test x"$mocversiongrep" != x"$mocversion"; then
+    # moc was not the qt4 one, try with moc-qt4
+    MOCQT4=`which moc-qt4`
+    mocversion=`$MOCQT4 -v 2>&1`
+    mocversiongrep=`echo $mocversion | grep "Qt 4"`
+    if test x"$mocversiongrep" != x"$mocversion"; then
+      # no valid moc found
+      enable_poppler_qt4=no;
+      MOCQT4="not found"
+    fi
+  fi
+  AC_SUBST(MOCQT4)
+  AC_MSG_RESULT([$MOCQT4])
+fi
+
 AM_CONDITIONAL(BUILD_POPPLER_QT4, test "x$enable_poppler_qt4" = "xyes")
 
 AC_ARG_ENABLE(gtk-test,
diff --git a/qt4/demos/Makefile.am b/qt4/demos/Makefile.am
index a1b1ba4..591bb82 100644
--- a/qt4/demos/Makefile.am
+++ b/qt4/demos/Makefile.am
@@ -16,7 +16,7 @@ SUFFIXES: .moc
 
 # This rule lets GNU make create any *.moc from the equivalent *.h
 .h.moc:
-	moc -i $< -o $@
+	$(MOCQT4) -i $< -o $@
 
 noinst_PROGRAMS = poppler_qt4viewer
 
diff --git a/qt4/src/Makefile.am b/qt4/src/Makefile.am
index c449336..de73c8a 100644
--- a/qt4/src/Makefile.am
+++ b/qt4/src/Makefile.am
@@ -63,7 +63,7 @@ libpoppler_qt4_la_LDFLAGS = -version-info 3:0:0
 
 # This rule lets GNU make create any *.moc from the equivalent *.h
 .h.moc:
-	moc -i $< -o $@
+	$(MOCQT4) -i $< -o $@
 
 poppler-optcontent.lo: poppler-optcontent.moc
 
diff --git a/qt4/tests/Makefile.am b/qt4/tests/Makefile.am
index 3d25a8b..d3437b3 100644
--- a/qt4/tests/Makefile.am
+++ b/qt4/tests/Makefile.am
@@ -15,7 +15,7 @@ LDADDS =					\
 SUFFIXES: .moc
 
 .cpp.moc:
-	moc -i $< -o $@
+	$(MOCQT4) -i $< -o $@
 
 noinst_PROGRAMS = test-poppler-qt4 stress-poppler-qt4 \
 	poppler-fonts test-password-qt4 stress-poppler-dir \


More information about the poppler mailing list