aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/proparser
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2016-10-24 21:01:22 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2016-11-01 17:33:58 +0000
commitc42b12c98e1b27ac7146c31fdcdbe53915cab2c8 (patch)
treec79453779f484cf1ef39a6692f5bb1708e06a0ed /src/shared/proparser
parent5e29347d9d9530521264e226326e45d4c9c08916 (diff)
introduce ProFileReader::fixifiedValues()
... and use it for PRECOMPILED_HEADER, INCLUDEPATH, and install target collection, instead of abusing ProFileReader::absoluteFileValues(). specifically, this falls back to a location in the build directory when the path is relative and the file cannot be found. in qmake, this somewhat weird behavior ensures that chaining extra compilers actually works (and also ensures a lot of frustration with non-clean source dirs ...). this also fixes INSTALLS with .CONFIG no_check_exists. Task-number: QTCREATORBUG-14848 Change-Id: Iaf9483c0c4586c464bd10a2aea7cbac7e0df1ec5 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/shared/proparser')
-rw-r--r--src/shared/proparser/profileevaluator.cpp18
-rw-r--r--src/shared/proparser/profileevaluator.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/src/shared/proparser/profileevaluator.cpp b/src/shared/proparser/profileevaluator.cpp
index 50bf4a89cf..e164a6cebc 100644
--- a/src/shared/proparser/profileevaluator.cpp
+++ b/src/shared/proparser/profileevaluator.cpp
@@ -102,6 +102,24 @@ QString ProFileEvaluator::sysrootify(const QString &path, const QString &baseDir
return isHostSystemPath ? path : option->sysroot + path;
}
+QStringList ProFileEvaluator::fixifiedValues(
+ const QString &variable, const QString &baseDirectory, const QString &buildDirectory) const
+{
+ QStringList result;
+ foreach (const QString &el, values(variable)) {
+ if (IoUtils::isAbsolutePath(el)) {
+ result << sysrootify(el, baseDirectory);
+ } else {
+ QString fn = QDir::cleanPath(baseDirectory + QLatin1Char('/') + el);
+ if (IoUtils::exists(fn))
+ result << fn;
+ else
+ result << QDir::cleanPath(buildDirectory + QLatin1Char('/') + el);
+ }
+ }
+ return result;
+}
+
QStringList ProFileEvaluator::absolutePathValues(
const QString &variable, const QString &baseDirectory) const
{
diff --git a/src/shared/proparser/profileevaluator.h b/src/shared/proparser/profileevaluator.h
index 27b26081b0..59285bea25 100644
--- a/src/shared/proparser/profileevaluator.h
+++ b/src/shared/proparser/profileevaluator.h
@@ -82,6 +82,8 @@ public:
QString value(const QString &variableName) const;
QStringList values(const QString &variableName) const;
QStringList values(const QString &variableName, const ProFile *pro) const;
+ QStringList fixifiedValues(
+ const QString &variable, const QString &baseDirectory, const QString &buildDirectory) const;
QStringList absolutePathValues(const QString &variable, const QString &baseDirectory) const;
QStringList absoluteFileValues(
const QString &variable, const QString &baseDirectory, const QStringList &searchDirs,