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/property.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'qmake/property.cpp') diff --git a/qmake/property.cpp b/qmake/property.cpp index af4ed0e9ee..32b6729c13 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -76,7 +76,9 @@ void QMakeProperty::reload() #ifdef QMAKE_VERSION_STR m_values["QMAKE_VERSION"] = ProString(QMAKE_VERSION_STR); #endif - m_values["QT_VERSION"] = ProString(qVersion()); +#ifdef QT_VERSION_STR + m_values["QT_VERSION"] = ProString(QT_VERSION_STR); +#endif } QMakeProperty::~QMakeProperty() @@ -142,7 +144,9 @@ int QMakeProperty::queryProperty(const QStringList &optionProperties, #ifdef QMAKE_VERSION_STR specialProps.append("QMAKE_VERSION"); #endif +#ifdef QT_VERSION_STR specialProps.append("QT_VERSION"); +#endif for (const QString &prop : std::as_const(specialProps)) { ProString val = value(ProKey(prop)); ProString pval = value(ProKey(prop + "/raw")); -- cgit v1.2.3