From d795e9ff5fb676115a5c4eb9604c35cedd3fb186 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 11 Jun 2013 16:08:30 +0200 Subject: introduce /src qmake property variants this is for shadow builds during build time, where the respective files are expected in the source dir. Change-Id: I18dcfbdef99e1562a51dacac333642cae8105ebd Reviewed-by: Joerg Bornemann --- qmake/library/qmakeglobals.cpp | 51 ++++++++++++++++++++++++++---------------- qmake/property.cpp | 4 ++++ 2 files changed, 36 insertions(+), 19 deletions(-) (limited to 'qmake') diff --git a/qmake/library/qmakeglobals.cpp b/qmake/library/qmakeglobals.cpp index 097244abc4..e47a4efe0b 100644 --- a/qmake/library/qmakeglobals.cpp +++ b/qmake/library/qmakeglobals.cpp @@ -323,33 +323,46 @@ bool QMakeGlobals::initProperties() QT_PCLOSE(proc); } #endif - foreach (QByteArray line, data.split('\n')) - { - int off = line.indexOf(':'); - if (off < 0) // huh? - continue; - if (line.endsWith('\r')) - line.chop(1); - QString name = QString::fromLatin1(line.left(off)); - ProString value = ProString(QDir::fromNativeSeparators( - QString::fromLocal8Bit(line.mid(off + 1)))); - properties.insert(ProKey(name), value); - if (name.startsWith(QLatin1String("QT_")) && !name.contains(QLatin1Char('/'))) { - if (name.startsWith(QLatin1String("QT_INSTALL_"))) { + foreach (QByteArray line, data.split('\n')) { + int off = line.indexOf(':'); + if (off < 0) // huh? + continue; + if (line.endsWith('\r')) + line.chop(1); + QString name = QString::fromLatin1(line.left(off)); + ProString value = ProString(QDir::fromNativeSeparators( + QString::fromLocal8Bit(line.mid(off + 1)))); + properties.insert(ProKey(name), value); + if (name.startsWith(QLatin1String("QT_"))) { + bool plain = !name.contains(QLatin1Char('/')); + if (!plain) { + if (!name.endsWith(QLatin1String("/get"))) + continue; + name.chop(4); + } + if (name.startsWith(QLatin1String("QT_INSTALL_"))) { + if (plain) { properties.insert(ProKey(name + QLatin1String("/raw")), value); properties.insert(ProKey(name + QLatin1String("/get")), value); - if (name == QLatin1String("QT_INSTALL_PREFIX") - || name == QLatin1String("QT_INSTALL_DATA") - || name == QLatin1String("QT_INSTALL_BINS")) { - name.replace(3, 7, QLatin1String("HOST")); + } + properties.insert(ProKey(name + QLatin1String("/src")), value); + if (name == QLatin1String("QT_INSTALL_PREFIX") + || name == QLatin1String("QT_INSTALL_DATA") + || name == QLatin1String("QT_INSTALL_BINS")) { + name.replace(3, 7, QLatin1String("HOST")); + if (plain) { properties.insert(ProKey(name), value); properties.insert(ProKey(name + QLatin1String("/get")), value); } - } else if (name.startsWith(QLatin1String("QT_HOST_"))) { - properties.insert(ProKey(name + QLatin1String("/get")), value); + properties.insert(ProKey(name + QLatin1String("/src")), value); } + } else if (name.startsWith(QLatin1String("QT_HOST_"))) { + if (plain) + properties.insert(ProKey(name + QLatin1String("/get")), value); + properties.insert(ProKey(name + QLatin1String("/src")), value); } } + } return true; } #else diff --git a/qmake/property.cpp b/qmake/property.cpp index 4685440b48..38d454cb5d 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -83,6 +83,7 @@ QMakeProperty::QMakeProperty() : settings(0) { for (int i = 0; i < sizeof(propList)/sizeof(propList[0]); i++) { QString name = QString::fromLatin1(propList[i].name); + m_values[ProKey(name + "/src")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectiveSourcePaths); m_values[ProKey(name + "/get")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectivePaths); QString val = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::FinalPaths); if (!propList[i].raw) { @@ -164,11 +165,14 @@ QMakeProperty::exec() ProString val = value(ProKey(prop)); ProString pval = value(ProKey(prop + "/raw")); ProString gval = value(ProKey(prop + "/get")); + ProString sval = value(ProKey(prop + "/src")); fprintf(stdout, "%s:%s\n", prop.toLatin1().constData(), val.toLatin1().constData()); if (!pval.isEmpty() && pval != val) fprintf(stdout, "%s/raw:%s\n", prop.toLatin1().constData(), pval.toLatin1().constData()); if (!gval.isEmpty() && gval != (pval.isEmpty() ? val : pval)) fprintf(stdout, "%s/get:%s\n", prop.toLatin1().constData(), gval.toLatin1().constData()); + if (!sval.isEmpty() && sval != gval) + fprintf(stdout, "%s/src:%s\n", prop.toLatin1().constData(), sval.toLatin1().constData()); } return true; } -- cgit v1.2.3