From 2dd6f1467fca051e977eeda0369b9b89e25065b1 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Tue, 6 Mar 2012 18:05:27 +0000 Subject: Allow qmake to find features when using mkspecs in nested dirs Commit 8e5eb1bddcfc introduced the assumtion that mkspecs are immediately below the mkspecs directory itself. This is not true for e.g. unsupported/blackberry-armv7le-qcc. This commit restores qmake's ability to find the "root" of the mkspecs collection no matter how deeply the actual mkspecs are nested. Task-number: QTBUG-24665 Change-Id: I98faaf8e6ae7b8524277aea6c17e685e507e37b3 Reviewed-by: Sean Harmer Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- qmake/project.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'qmake/project.cpp') diff --git a/qmake/project.cpp b/qmake/project.cpp index 8b5ed1e2ac..b82b793319 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -579,14 +579,19 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0) // The spec is already platform-dependent, so no subdirs here. feature_roots << Option::mkfile::qmakespec + base_concat; + // Also check directly under the root directory of the mkspecs collection QFileInfo specfi(Option::mkfile::qmakespec); - if (!specfi.isRoot()) { - QDir specdir(specfi.absolutePath()); - if (specdir.exists(QLatin1String("features"))) { - for(QStringList::Iterator concat_it = concat.begin(); - concat_it != concat.end(); ++concat_it) - feature_roots << (specdir.path() + (*concat_it)); + QDir specrootdir(specfi.absolutePath()); + while (!specrootdir.isRoot()) { + const QString specrootpath = specrootdir.path(); + if (specrootpath.endsWith(mkspecs_concat)) { + if (QFile::exists(specrootpath + base_concat)) + for (QStringList::Iterator concat_it = concat.begin(); + concat_it != concat.end(); ++concat_it) + feature_roots << (specrootpath + (*concat_it)); + break; } + specrootdir.cdUp(); } } for(QStringList::Iterator concat_it = concat.begin(); -- cgit v1.2.3