From 98a3634299e29104dee391145728dbad9797d7b3 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 13 Jan 2023 10:53:43 +0100 Subject: Make qmake and qtpaths report Qt version baked into the binaries QMake and qtpaths used qVersion() to report Qt's version number. This is problematic if those tools are run in an environment where a different Qt version is loaded (e.g. by setting LD_LIBRARY_PATH). This reverts commit a783c3d574a1400c4dfdd32975fc511f095df8b2, which changed the use of the QT_VERSION define to a qVersion() call in qmake. Additionally, we use QT_VERSION in qtpaths too for consistency. Pick-to: 6.5 Change-Id: I6c8a1aa6ee6169becd7c685a98ce23c22c3864c7 Reviewed-by: hjk Reviewed-by: Alexandru Croitor --- qmake/generators/makefile.cpp | 2 +- qmake/generators/unix/unixmake2.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'qmake/generators') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 257601eaf7..cc985a878b 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2298,7 +2298,7 @@ MakefileGenerator::writeHeader(QTextStream &t) { t << "#############################################################################\n"; t << "# Makefile for building: " << escapeFilePath(var("TARGET")) << Qt::endl; - t << "# Generated by qmake (" QMAKE_VERSION_STR ") (Qt " << qVersion() << ")\n"; + t << "# Generated by qmake (" QMAKE_VERSION_STR ") (Qt " QT_VERSION_STR ")\n"; t << "# Project: " << fileFixify(project->projectFile()) << Qt::endl; t << "# Template: " << var("TEMPLATE") << Qt::endl; if(!project->isActiveConfig("build_pass")) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 20ba642e9d..19e0b73ab4 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1478,7 +1478,7 @@ UnixMakefileGenerator::writeLibtoolFile() QTextStream t(&ft); t << "# " << lname << " - a libtool library file\n"; t << "# Generated by qmake/libtool (" QMAKE_VERSION_STR ") (Qt " - << qVersion() << ")"; + << QT_VERSION_STR << ")"; t << "\n"; t << "# The name that we can dlopen(3).\n" -- cgit v1.2.3