aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt6/qtbase/0002-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch
blob: 5d2f2eb1426f50e35192b2719876a1622c8c06f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From bc9476229b98e567420e177a8ede27fd28451895 Mon Sep 17 00:00:00 2001
From: Holger Freyther <zecke@selfish.org>
Date: Wed, 26 Sep 2012 17:22:30 +0200
Subject: [PATCH] qlibraryinfo: allow to set qt.conf from the outside using the
 environment

Allow to set a qt.conf from the outside using the environment. This allows
to inject new prefixes and other paths into qmake. This is needed when using
the same qmake binary to build qt/x11 and qt/embedded

Upstream-Status: Inappropriate [embedded specific]
  again very OE specific to read everything from environment (reusing the same
  qmake from sstate and replacing all configured paths in it with qt.conf from
  environment).

Change-Id: I41595c6ce7514e8f197d0a19a1308c9460037d1b
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 src/corelib/global/qlibraryinfo.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index a4764713c4..0fc456472d 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -126,7 +126,12 @@ static QSettings *findConfiguration()
     if (QLibraryInfoPrivate::qtconfManualPath)
         return new QSettings(*QLibraryInfoPrivate::qtconfManualPath, QSettings::IniFormat);
 
-    QString qtconfig = QStringLiteral(":/qt/etc/qt.conf");
+    QByteArray config = getenv("OE_QMAKE_QTCONF_PATH");
+    QString qtconfig = QFile::decodeName(config);
+    if (QFile::exists(qtconfig))
+        return new QSettings(qtconfig, QSettings::IniFormat);
+
+    qtconfig = QStringLiteral(":/qt/etc/qt.conf");
     if (QFile::exists(qtconfig))
         return new QSettings(qtconfig, QSettings::IniFormat);
 #ifdef Q_OS_DARWIN