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>
This commit is contained in:
Oswald Buddenhagen
2012-06-18 20:09:00 +02:00
parent ce71932ca2
commit 8d7546d006
4 changed files with 25 additions and 0 deletions

View File

@@ -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),

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;