summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2022-02-11 10:58:59 +0100
committerGitHub <noreply@github.com>2022-02-11 10:58:59 +0100
commit24fe11b2455e233db3fddcf85b82816e4cc22caa (patch)
tree0e662117ae3b930cb47b0bd361a01b7b5557ec44 /m4
parent358440bf8d35247ca9824ab0ba7d2220eb006c14 (diff)
parent3444eac4af4fd93458552efaffe9d2343e2fb993 (diff)
downloadautoconf-archive-24fe11b2455e233db3fddcf85b82816e4cc22caa.tar.gz
Merge pull request #243 from rmathar/master
detect qtmake-qt5, moc-qt5 etc in ax_have_qt.m4
Diffstat (limited to 'm4')
-rw-r--r--m4/ax_have_qt.m423
1 files changed, 15 insertions, 8 deletions
diff --git a/m4/ax_have_qt.m4 b/m4/ax_have_qt.m4
index bd7178d..1d20f7e 100644
--- a/m4/ax_have_qt.m4
+++ b/m4/ax_have_qt.m4
@@ -64,8 +64,15 @@ AC_DEFUN([AX_HAVE_QT],
AC_REQUIRE([AC_PATH_XTRA])
AC_MSG_CHECKING(for Qt)
+
+ # openSUSE leap 15.3 installs qmake-qt5, not qmake, for example.
+ # Store the full name (like qmake-qt5) into am_have_qt_qmexe
+ # and the specifier (like -qt5 or empty) into am_have_qt_qmexe_suff.
+ AC_CHECK_PROGS(am_have_qt_qmexe,qmake qmake-qt6 qmake-qt5,[])
+ am_have_qt_qmexe_suff=`echo $am_have_qt_qmexe | cut -b 6-`
# If we have Qt5 or later in the path, we're golden
- ver=`qmake --version | grep -o "Qt version ."`
+ ver=`$am_have_qt_qmexe --version | grep -o "Qt version ."`
+
if test "$ver" ">" "Qt version 4"; then
have_qt=yes
# This pro file dumps qmake's variables, but it only works on Qt 5 or later
@@ -111,21 +118,21 @@ percent.target = %
percent.commands = @echo -n "\$(\$(@))\ "
QMAKE_EXTRA_TARGETS += percent
EOF
- qmake $am_have_qt_pro -o $am_have_qt_makefile
+ $am_have_qt_qmexe $am_have_qt_pro -o $am_have_qt_makefile
QT_CXXFLAGS=`cd $am_have_qt_dir; make -s -f $am_have_qt_makefile CXXFLAGS INCPATH`
QT_LIBS=`cd $am_have_qt_dir; make -s -f $am_have_qt_makefile LIBS`
rm $am_have_qt_pro $am_have_qt_makefile
rmdir $am_have_qt_dir
# Look for specific tools in $PATH
- QT_MOC=`which moc`
- QT_UIC=`which uic`
- QT_RCC=`which rcc`
- QT_LRELEASE=`which lrelease`
- QT_LUPDATE=`which lupdate`
+ QT_MOC=`which moc$am_have_qt_qmexe_suff`
+ QT_UIC=`which uic$am_have_qt_qmexe_suff`
+ QT_RCC=`which rcc$am_have_qt_qmexe_suff`
+ QT_LRELEASE=`which lrelease$am_have_qt_qmexe_suff`
+ QT_LUPDATE=`which lupdate$am_have_qt_qmexe_suff`
# Get Qt version from qmake
- QT_DIR=`qmake --version | grep -o -E /.+`
+ QT_DIR=`$am_have_qt_qmexe --version | grep -o -E /.+`
# All variables are defined, report the result
AC_MSG_RESULT([$have_qt: