From d5a0cf45ebbd6a5911f8bd208fe355eb990b5388 Mon Sep 17 00:00:00 2001 From: Holger Freyther 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: Pending Signed-off-by: Martin Jansa --- src/corelib/global/qlibraryinfo.cpp | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index ccf0718..497e72e 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -49,6 +49,8 @@ QT_BEGIN_NAMESPACE extern QString qt_libraryInfoFile(); QT_END_NAMESPACE +#include +#include #elif defined(QT_BOOTSTRAPPED) QString qt_libraryInfoFile() { @@ -142,6 +143,11 @@ QSettings *QLibraryInfoPrivate::findConfiguration() #ifdef QT_BOOTSTRAPPED if(!QFile::exists(qtconfig)) qtconfig = qt_libraryInfoFile(); + if (!QFile::exists(qtconfig)) { + QByteArray config = getenv("QT_CONF_PATH"); + qtconfig = QFile::decodeName(config); + printf("using qt.conf %s", qtconfig.toLatin1().data()); + } #else if (!QFile::exists(qtconfig) && QCoreApplication::instance()) { #ifdef Q_OS_MAC -- 1.7.4.1