summaryrefslogtreecommitdiffstats
path: root/qmake/project.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-06-07 12:48:40 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-06-19 16:46:02 +0200
commitc80697cfbe9071152e49559e9f375352cd205029 (patch)
treea74c4257cfc2383c3112ca4cace7a3e286e879d8 /qmake/project.cpp
parente894155a41e6e2d504f8e863e3d3a5b87e909d20 (diff)
allow setting QMAKEPATH and QMAKEFEATURES in .qmake.cache
Change-Id: Ie383abb57c06cb49d38345d64750837b8fe14c70 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'qmake/project.cpp')
-rw-r--r--qmake/project.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 42967df461..b141860556 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -189,6 +189,9 @@ struct parser_info {
static QString project_root;
static QString project_build_root;
+static QStringList cached_qmakepath;
+static QStringList cached_qmakefeatures;
+
static QStringList *all_feature_roots[2] = { 0, 0 };
static void
@@ -587,6 +590,7 @@ QStringList qmake_feature_paths(QMakeProperty *prop, bool host_build)
}
QStringList feature_roots = splitPathList(QString::fromLocal8Bit(qgetenv("QMAKEFEATURES")));
+ feature_roots += cached_qmakefeatures;
if(prop)
feature_roots += splitPathList(prop->value("QMAKEFEATURES"));
if (!project_build_root.isEmpty())
@@ -594,6 +598,7 @@ QStringList qmake_feature_paths(QMakeProperty *prop, bool host_build)
concat_it != concat.end(); ++concat_it)
feature_roots << (project_build_root + (*concat_it));
QStringList qmakepath = splitPathList(QString::fromLocal8Bit(qgetenv("QMAKEPATH")));
+ qmakepath += cached_qmakepath;
foreach (const QString &path, qmakepath)
foreach (const QString &cat, concat)
feature_roots << (path + mkspecs_concat + cat);
@@ -632,6 +637,7 @@ QStringList qmake_mkspec_paths()
const QString concat = QLatin1String("/mkspecs");
QStringList qmakepath = splitPathList(QString::fromLocal8Bit(qgetenv("QMAKEPATH")));
+ qmakepath += cached_qmakepath;
foreach (const QString &path, qmakepath)
ret << (path + concat);
if (!project_build_root.isEmpty())
@@ -1330,6 +1336,8 @@ QMakeProject::read(uchar cmd)
project_build_root.clear();
+ QStringList qmakepath;
+ QStringList qmakefeatures;
if (Option::mkfile::do_cache) { // parse the cache
if (Option::mkfile::cachefile.isEmpty()) { //find it as it has not been specified
QDir dir(Option::output_dir);
@@ -1356,6 +1364,13 @@ QMakeProject::read(uchar cmd)
if (Option::mkfile::xqmakespec.isEmpty())
Option::mkfile::xqmakespec = Option::mkfile::qmakespec;
}
+ qmakepath = cache.value(QLatin1String("QMAKEPATH"));
+ qmakefeatures = cache.value(QLatin1String("QMAKEFEATURES"));
+ if (qmakepath != cached_qmakepath || qmakefeatures != cached_qmakefeatures) {
+ cached_qmakepath = qmakepath;
+ cached_qmakefeatures = qmakefeatures;
+ invalidateFeatureRoots();
+ }
if (Option::output_dir.startsWith(project_build_root))
Option::mkfile::cachefile_depth =
@@ -3215,6 +3230,15 @@ QMakeProject::doProjectTest(QString func, QList<QStringList> args_list, QHash<QS
if (oldval == newval)
return true;
base_vars[dstvar] = newval;
+ do {
+ if (dstvar == "QMAKEPATH")
+ cached_qmakepath = newval;
+ else if (dstvar == "QMAKEFEATURES")
+ cached_qmakefeatures = newval;
+ else
+ break;
+ invalidateFeatureRoots();
+ } while (false);
if (!persist)
return true;
varstr = dstvar;