comparison 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
comparison
equal deleted inserted replaced
263:96416310ea14 264:9a04802848c0
79 # This pro file dumps qmake's variables, but it only works on Qt 5 or later 79 # This pro file dumps qmake's variables, but it only works on Qt 5 or later
80 am_have_qt_dir=`mktemp -d` 80 am_have_qt_dir=`mktemp -d`
81 am_have_qt_pro="$am_have_qt_dir/test.pro" 81 am_have_qt_pro="$am_have_qt_dir/test.pro"
82 am_have_qt_stash="$am_have_qt_dir/.qmake.stash" 82 am_have_qt_stash="$am_have_qt_dir/.qmake.stash"
83 am_have_qt_makefile="$am_have_qt_dir/Makefile" 83 am_have_qt_makefile="$am_have_qt_dir/Makefile"
84 am_have_qt_makefile_vars="$am_have_qt_dir/Makefile.vars"
84 # http://qt-project.org/doc/qt-5/qmake-variable-reference.html#qt 85 # http://qt-project.org/doc/qt-5/qmake-variable-reference.html#qt
85 cat > $am_have_qt_pro << EOF 86 cat > $am_have_qt_pro << EOF
86 win32 { 87 win32 {
87 CONFIG -= debug_and_release 88 CONFIG -= debug_and_release
88 CONFIG += release 89 CONFIG += release
89 } 90 }
90 qtHaveModule(core): QT += core 91 qtHaveModule(core): QT += core
91 qtHaveModule(gui): QT += gui 92 qtHaveModule(gui): QT += gui
92 qtHaveModule(widgets): QT += widgets 93 qtHaveModule(widgets): QT += widgets
93 percent.target = % 94 EOF
94 percent.commands = @echo -n "\$(\$(@))\ " 95 cat > "$am_have_qt_makefile_vars" << EOF
95 QMAKE_EXTRA_TARGETS += percent 96 include $am_have_qt_makefile
97
98 # todo: use printf here
99 CXXFLAGS:
100 @echo \$(CXXFLAGS) \$(INCPATH)
101
102 LIBS:
103 @echo \$(LIBS)
96 EOF 104 EOF
97 $QMAKE $am_have_qt_pro -o $am_have_qt_makefile 105 $QMAKE $am_have_qt_pro -o $am_have_qt_makefile
98 QT_CXXFLAGS=`cd $am_have_qt_dir; make -s -f $am_have_qt_makefile CXXFLAGS INCPATH` 106 QT_CXXFLAGS=`cd $am_have_qt_dir; make -s -f $am_have_qt_makefile_vars CXXFLAGS`
99 QT_LIBS=`cd $am_have_qt_dir; make -s -f $am_have_qt_makefile LIBS` 107 QT_LIBS=`cd $am_have_qt_dir; make -s -f $am_have_qt_makefile_vars LIBS`
100 rm $am_have_qt_pro $am_have_qt_stash $am_have_qt_makefile 108 rm $am_have_qt_pro $am_have_qt_stash $am_have_qt_makefile
101 rmdir $am_have_qt_dir 109 rmdir $am_have_qt_dir
102 110
103 # Look for specific tools in $PATH 111 # Look for specific tools in $PATH
104 QT_MOC=`which moc$am_have_qt_qmexe_suff` 112 QT_MOC=`which moc$am_have_qt_qmexe_suff`