[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 8/8] Qt: added AM_PROG_MOC, updated Changelog and documentation.
From: |
Gergely Risko |
Subject: |
[PATCH 8/8] Qt: added AM_PROG_MOC, updated Changelog and documentation. |
Date: |
Thu, 9 Jul 2009 13:44:59 +0300 |
---
ChangeLog | 8 ++++++++
doc/automake.texi | 18 ++++++++++++++++--
m4/Makefile.am | 1 +
m4/Makefile.in | 1 +
m4/qt.m4 | 32 ++++++++++++++++++++++++++++++++
5 files changed, 58 insertions(+), 2 deletions(-)
create mode 100644 m4/qt.m4
diff --git a/ChangeLog b/ChangeLog
index b9abf39..d1792c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,14 @@
* automake.in (handle_single_transform): added support for Qt, via
the new prog_QTSOURCES variable.
+ * m4/qt.m4 (AM_PROG_MOC): new macro for checking the existence of
+ Qt's Meta Object Compiler
+ * tests/qt.test: new test
+ * tests/qt2.test: new test
+ * tests/qt3.test: new test
+ * tests/qt4.test: new test
+ * tests/qt5.test: new test
+ * doc/automake.texi (Qt Support): new section on Qt
* NEWS: updated.
2009-06-07 Ralf Wildenhues <address@hidden>
diff --git a/doc/automake.texi b/doc/automake.texi
index aa92729..117cc6a 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -6683,10 +6683,12 @@ The shipped AM_PROG_MOC macro should be used to look
for the MOC tool on
the build system. For checking the existence of the Qt library and
different parts of it, you can use pkg-config.
address@hidden AM_PROG_MOC
address@hidden AM_PROG_MOC (@ovar{MINIMUM-VERSION})
Tries to find Qt's Meta Object Compiler and if found the variable
@code{MOC} will be set. The value of this variable will be used during
-the compilation to generate meta object code.
+the compilation to generate meta object code. Optionally you can give a
+minimum version which should be checked for. The default is 58, that
+version was shipped with Qt 4.0.1.
@end defmac
With Qt's Meta Object Compiler C++ source can be generated from headers
@@ -6714,6 +6716,18 @@ AM_CXXFLAGS = `pkg-config --cflags QtGui`
AM_LDFLAGS = `pkg-config --libs QtGui`
@end example
+The configure.ac for this project:
address@hidden
+AC_INIT([cutegammon], [0.1])
+AM_INIT_AUTOMAKE([-Wall foreign])
+
+AC_PROG_CXX
+AM_PROG_MOC
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
address@hidden example
+
In some interesting situations it may be needed to generate meta object
code from C++ source files. The usual way to handle this in the Qt
world is to generate meta object code in a file (named @file{foo.moc}
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 3ea8840..d29b5a7 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -49,6 +49,7 @@ obsolete.m4 \
options.m4 \
protos.m4 \
python.m4 \
+qt.m4 \
regex.m4 \
runlog.m4 \
sanity.m4 \
diff --git a/m4/Makefile.in b/m4/Makefile.in
index df6b81b..74460b6 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -195,6 +195,7 @@ obsolete.m4 \
options.m4 \
protos.m4 \
python.m4 \
+qt.m4 \
regex.m4 \
runlog.m4 \
sanity.m4 \
diff --git a/m4/qt.m4 b/m4/qt.m4
new file mode 100644
index 0000000..d332ccd
--- /dev/null
+++ b/m4/qt.m4
@@ -0,0 +1,32 @@
+# Autoconf support for the Qt library
+
+# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# Check if the MOC utility from Qt exists in `PATH'. If it is found,
+# the variable MOC is set. Optionally a minimum release number of the
+# compiler can be requested. The default is to depend on version 58
+# at least, it was released with Qt 4.0.1.
+#
+# AM_PROG_MOC([MINIMUM-VERSION])
+# --------------------------------
+AC_DEFUN([AM_PROG_MOC],
+[AC_PATH_PROG([MOC], [moc], [])
+ AS_IF([test -z "$MOC"],
+ [AC_MSG_ERROR([No Meta Object Compiler (MOC) found, probably Qt is not
installed.])],
+ [AS_IF([test -n "$1"],
+ [am__moc_expversion=$1],
+ [am__moc_expversion=58])])
+ AC_MSG_CHECKING([$MOC is at least version $am__moc_expversion])
+ am__moc_version=`$MOC -v 2>&1 | sed 's/.* version //;s/ .*//'`
+ AS_VERSION_COMPARE([$am__moc_expversion], ["$am__moc_version"],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([MOC version $1 not found.])])
+])
--
1.6.3.3
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH 8/8] Qt: added AM_PROG_MOC, updated Changelog and documentation.,
Gergely Risko <=