From c3a1af63ae8a7475d093fe4372d86360cebfa541 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 23 Feb 2012 17:30:58 +0100 Subject: [PATCH] search for default spec just like for other ones that way qtbase will find its spec without hacking .qmake.cache. note that passing "-spec default" on the command line would have already triggered the normal path, so artificial limitation did not even provide safety against abuse (it is arguably pointless/counterproductive for other projects than qtbase to have a default spec). Change-Id: Ib0c3e6498fd70cd6f9561951d72a47165878bb33 Reviewed-by: Joerg Bornemann Reviewed-by: Marius Storm-Olsen --- qmake/project.cpp | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/qmake/project.cpp b/qmake/project.cpp index 6793ed3be6..2d339ccb63 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -1291,26 +1291,12 @@ QMakeProject::read(uchar cmd) } if (cmd & ReadSetup) { // parse mkspec QString qmakespec = fixEnvVariables(Option::mkfile::qmakespec); - QStringList mkspec_roots = qmake_mkspec_paths(); - debug_msg(2, "Looking for mkspec %s in (%s)", qmakespec.toLatin1().constData(), - mkspec_roots.join("::").toLatin1().constData()); - if(qmakespec.isEmpty()) { - for(QStringList::ConstIterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) { - QString mkspec = (*it) + QLatin1String("/default"); - QFileInfo default_info(mkspec); - if(default_info.exists() && default_info.isDir()) { - qmakespec = mkspec; - break; - } - } - if(qmakespec.isEmpty()) { - fprintf(stderr, "QMAKESPEC has not been set, so configuration cannot be deduced.\n"); - return false; - } - Option::mkfile::qmakespec = qmakespec; - } - + if (qmakespec.isEmpty()) + qmakespec = "default"; if(QDir::isRelativePath(qmakespec)) { + QStringList mkspec_roots = qmake_mkspec_paths(); + debug_msg(2, "Looking for mkspec %s in (%s)", qmakespec.toLatin1().constData(), + mkspec_roots.join("::").toLatin1().constData()); bool found_mkspec = false; for(QStringList::ConstIterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) { QString mkspec = (*it) + QLatin1Char('/') + qmakespec;