aboutsummaryrefslogtreecommitdiffstats
path: root/aclocal-fallback/qt.m4
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2013-02-07 20:51:52 +0000
committerJeff Morriss <jeff.morriss.ws@gmail.com>2013-02-07 20:51:52 +0000
commit8a6b4d596dbf6904c69a67c688318343e0e5ea84 (patch)
tree7eed006f4b581512bc7c20bbe6a46c8c41b92152 /aclocal-fallback/qt.m4
parent669e68dfded50f813464eeb3dc4e334578f85de5 (diff)
QPropertyAnimation is needed for Qt builds and isn't present until Qt 4.6.0.
Add a (crude) check for the Qt version, making 4.6.0 the minimum. The existing checks in configure.ac should be moved into into this new module. svn path=/trunk/; revision=47537
Diffstat (limited to 'aclocal-fallback/qt.m4')
-rw-r--r--aclocal-fallback/qt.m456
1 files changed, 56 insertions, 0 deletions
diff --git a/aclocal-fallback/qt.m4 b/aclocal-fallback/qt.m4
new file mode 100644
index 0000000000..c82dc3fed0
--- /dev/null
+++ b/aclocal-fallback/qt.m4
@@ -0,0 +1,56 @@
+# Based on gtk-2.0.m4.
+# $Id$
+
+dnl AM_PATH_QT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for Qt+
+dnl Should also define QT_CFLAGS and QT_LIBS but not done yet...
+dnl
+AC_DEFUN([AM_PATH_QT],
+[
+
+ pkg_config_args=Qt
+
+ no_qt=""
+
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+
+ if test x$PKG_CONFIG != xno ; then
+ if pkg-config --atleast-pkgconfig-version 0.7 ; then
+ :
+ else
+ echo *** pkg-config too old; version 0.7 or better required.
+ no_qt=yes
+ PKG_CONFIG=no
+ fi
+ else
+ no_qt=yes
+ fi
+
+ min_qt_version=ifelse([$1], ,4.0.0,$1)
+ AC_MSG_CHECKING(for Qt - version >= $min_qt_version)
+
+ if test x"$no_qt" = x ; then
+ QT_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
+ QT_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
+ qt_config_major_version=`$PKG_CONFIG --modversion $pkg_config_args | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ qt_config_minor_version=`$PKG_CONFIG --modversion $pkg_config_args | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ qt_config_micro_version=`$PKG_CONFIG --modversion $pkg_config_args | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+
+ if $PKG_CONFIG --atleast-version $min_qt_version $pkg_config_args; then
+ :
+ else
+ no_qt=yes
+ fi
+ fi
+
+ if test x"$no_qt" = x ; then
+ AC_MSG_RESULT(yes (version $qt_config_major_version.$qt_config_minor_version.$qt_config_micro_version))
+ ifelse([$2], , :, [$2])
+ else
+ ifelse([$3], , :, [$3])
+ fi
+
+])