summaryrefslogtreecommitdiff
path: root/m4/ax_have_qt.m4
diff options
context:
space:
mode:
authorCedric Cellier <rixed@happyleptic.org>2019-05-22 07:03:49 +0200
committerCedric Cellier <rixed@happyleptic.org>2019-05-22 17:07:01 +0200
commitb15e688294b3be8481e477b16b52c7f81bc7eb58 (patch)
tree4ec44830d8395bdbd645ce99c9310c470a153c38 /m4/ax_have_qt.m4
parentfce06d3b8d02dcc50a79c9efb21a3ae91fb041f7 (diff)
downloadautoconf-archive-b15e688294b3be8481e477b16b52c7f81bc7eb58.tar.gz
ax_have_qt: workaround qmake bug when building out of tree
Makefile generated by qmake include paths relative to the build directory that is assumed to be current.
Diffstat (limited to 'm4/ax_have_qt.m4')
-rw-r--r--m4/ax_have_qt.m412
1 files changed, 7 insertions, 5 deletions
diff --git a/m4/ax_have_qt.m4 b/m4/ax_have_qt.m4
index ca9e499..bd7178d 100644
--- a/m4/ax_have_qt.m4
+++ b/m4/ax_have_qt.m4
@@ -54,7 +54,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 16
+#serial 17
AU_ALIAS([BNV_HAVE_QT], [AX_HAVE_QT])
AC_DEFUN([AX_HAVE_QT],
@@ -69,8 +69,9 @@ AC_DEFUN([AX_HAVE_QT],
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
- am_have_qt_pro=`mktemp`
- am_have_qt_makefile=`mktemp`
+ am_have_qt_dir=`mktemp -d`
+ am_have_qt_pro="$am_have_qt_dir/test.pro"
+ am_have_qt_makefile="$am_have_qt_dir/Makefile"
# http://qt-project.org/doc/qt-5/qmake-variable-reference.html#qt
cat > $am_have_qt_pro << EOF
win32 {
@@ -111,9 +112,10 @@ percent.commands = @echo -n "\$(\$(@))\ "
QMAKE_EXTRA_TARGETS += percent
EOF
qmake $am_have_qt_pro -o $am_have_qt_makefile
- QT_CXXFLAGS=`make -s -f $am_have_qt_makefile CXXFLAGS INCPATH`
- QT_LIBS=`make -s -f $am_have_qt_makefile LIBS`
+ 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`