diff m4/m4_ax_have_qt.m4 @ 264:9a04802848c0

*: improve multiple things e.g. making some strings.cc functions modify strings in-place, improving m4_ax_have_qt.m4 code, making anime_db.cc rely on std::optional rather than std::shared_ptr (which was stupid anyway)
author Paper <paper@paper.us.eu.org>
date Thu, 11 Apr 2024 10:15:57 -0400
parents 862d0d8619f6
children 09c5bd74fe93
line wrap: on
line diff
--- a/m4/m4_ax_have_qt.m4	Wed Apr 03 20:46:40 2024 -0400
+++ b/m4/m4_ax_have_qt.m4	Thu Apr 11 10:15:57 2024 -0400
@@ -81,6 +81,7 @@
     am_have_qt_pro="$am_have_qt_dir/test.pro"
     am_have_qt_stash="$am_have_qt_dir/.qmake.stash"
     am_have_qt_makefile="$am_have_qt_dir/Makefile"
+    am_have_qt_makefile_vars="$am_have_qt_dir/Makefile.vars"
     # http://qt-project.org/doc/qt-5/qmake-variable-reference.html#qt
     cat > $am_have_qt_pro << EOF
 win32 {
@@ -90,13 +91,20 @@
 qtHaveModule(core):    QT += core
 qtHaveModule(gui):     QT += gui
 qtHaveModule(widgets): QT += widgets
-percent.target = %
-percent.commands = @echo -n "\$(\$(@))\ "
-QMAKE_EXTRA_TARGETS += percent
+EOF
+    cat > "$am_have_qt_makefile_vars" << EOF
+include $am_have_qt_makefile
+
+# todo: use printf here
+CXXFLAGS:
+	@echo \$(CXXFLAGS) \$(INCPATH)
+
+LIBS:
+	@echo \$(LIBS)
 EOF
     $QMAKE $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`
+    QT_CXXFLAGS=`cd $am_have_qt_dir; make -s -f $am_have_qt_makefile_vars CXXFLAGS`
+    QT_LIBS=`cd $am_have_qt_dir; make -s -f $am_have_qt_makefile_vars LIBS`
     rm $am_have_qt_pro $am_have_qt_stash $am_have_qt_makefile
     rmdir $am_have_qt_dir