diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-06-18 20:09:00 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-07-09 21:18:12 +0200 |
commit | 8d7546d006bc12f8c4b8edbdb1b9e6fb7a3357de (patch) | |
tree | d893790e2bd639be8b1446d8e6833526df9b9377 /src/shared | |
parent | ce71932ca244a2a4988fa08094a82347e57074eb (diff) | |
download | qt-creator-8d7546d006bc12f8c4b8edbdb1b9e6fb7a3357de.tar.gz |
allow setting QMAKEPATH and QMAKEFEATURES in .qmake.cache
follow suit with qmake ...
Change-Id: Idc957b607bbc87f92c8729946b208f9c24a23b4b
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/proparser/proitems.cpp | 10 | ||||
-rw-r--r-- | src/shared/proparser/proitems.h | 1 | ||||
-rw-r--r-- | src/shared/proparser/qmakeevaluator.cpp | 12 | ||||
-rw-r--r-- | src/shared/proparser/qmakeevaluator.h | 2 |
4 files changed, 25 insertions, 0 deletions
diff --git a/src/shared/proparser/proitems.cpp b/src/shared/proparser/proitems.cpp index 3502bd761a..eb14dd4b47 100644 --- a/src/shared/proparser/proitems.cpp +++ b/src/shared/proparser/proitems.cpp @@ -34,6 +34,7 @@ #include <QFileInfo> #include <QSet> +#include <QStringList> QT_BEGIN_NAMESPACE @@ -348,6 +349,15 @@ void ProStringList::removeDuplicates() erase(begin() + j, end()); } +QStringList ProStringList::toQStringList() const +{ + QStringList ret; + ret.reserve(size()); + foreach (const ProString &str, *this) + ret << str.toQString(); + return ret; +} + ProFile::ProFile(const QString &fileName) : m_refCount(1), m_fileName(fileName), diff --git a/src/shared/proparser/proitems.h b/src/shared/proparser/proitems.h index ece9ca8f3f..3d4c4296ec 100644 --- a/src/shared/proparser/proitems.h +++ b/src/shared/proparser/proitems.h @@ -126,6 +126,7 @@ public: ProStringList(const ProString &str) { *this << str; } QString join(const QString &sep) const; void removeDuplicates(); + QStringList toQStringList() const; }; typedef QHash<ProString, ProStringList> ProValueMap; diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp index 5942e0de60..fe1ebf7c98 100644 --- a/src/shared/proparser/qmakeevaluator.cpp +++ b/src/shared/proparser/qmakeevaluator.cpp @@ -175,6 +175,8 @@ void QMakeEvaluator::initFrom(const QMakeEvaluator &other) m_qmakespec = other.m_qmakespec; m_qmakespecFull = other.m_qmakespecFull; m_qmakespecName = other.m_qmakespecName; + m_qmakepath = other.m_qmakepath; + m_qmakefeatures = other.m_qmakefeatures; m_featureRoots = other.m_featureRoots; } @@ -1042,6 +1044,8 @@ bool QMakeEvaluator::loadSpec() } if (qmakespec.isEmpty()) qmakespec = evaluator.first(ProString("QMAKESPEC")).toQString(); + m_qmakepath = evaluator.values(ProString("QMAKEPATH")).toQStringList(); + m_qmakefeatures = evaluator.values(ProString("QMAKEFEATURES")).toQStringList(); } if (qmakespec.isEmpty()) @@ -1235,6 +1239,9 @@ QStringList QMakeEvaluator::qmakeMkspecPaths() const foreach (const QString &it, m_option->getPathListEnv(QLatin1String("QMAKEPATH"))) ret << it + concat; + foreach (const QString &it, m_qmakepath) + ret << it + concat; + if (!m_buildRoot.isEmpty()) ret << m_buildRoot + concat; if (!m_sourceRoot.isEmpty()) @@ -1256,6 +1263,8 @@ QStringList QMakeEvaluator::qmakeFeaturePaths() const foreach (const QString &f, m_option->getPathListEnv(QLatin1String("QMAKEFEATURES"))) feature_roots += f; + feature_roots += m_qmakefeatures; + feature_roots += m_option->propertyValue(ProString("QMAKEFEATURES")).toQString(m_mtmp).split( m_option->dirlist_sep, QString::SkipEmptyParts); @@ -1268,6 +1277,9 @@ QStringList QMakeEvaluator::qmakeFeaturePaths() const foreach (const QString &item, m_option->getPathListEnv(QLatin1String("QMAKEPATH"))) feature_bases << (item + mkspecs_concat); + foreach (const QString &item, m_qmakepath) + feature_bases << (item + mkspecs_concat); + if (!m_qmakespecFull.isEmpty()) { // The spec is already platform-dependent, so no subdirs here. feature_roots << (m_qmakespecFull + features_concat); diff --git a/src/shared/proparser/qmakeevaluator.h b/src/shared/proparser/qmakeevaluator.h index 702213274a..40812366a4 100644 --- a/src/shared/proparser/qmakeevaluator.h +++ b/src/shared/proparser/qmakeevaluator.h @@ -206,6 +206,8 @@ public: QString m_cachefile; QString m_sourceRoot; QString m_buildRoot; + QStringList m_qmakepath; + QStringList m_qmakefeatures; QStringList m_featureRoots; ProFunctionDefs m_functionDefs; ProStringList m_returnValue; |