-rw-r--r-- | qmake/project.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp index ae24193..96cdad8 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -428,53 +428,60 @@ QMakeProject::read(QString project, QString) } if(Option::mkfile::cachefile_depth == -1) Option::mkfile::cachefile_depth = 1; else Option::mkfile::cachefile_depth++; } } if(!Option::mkfile::cachefile.isEmpty()) { read(Option::mkfile::cachefile, cache); if(Option::mkfile::qmakespec.isEmpty() && !cache["QMAKESPEC"].isEmpty()) Option::mkfile::qmakespec = cache["QMAKESPEC"].first(); } } /* parse mkspec */ QStringList mkspec_roots; /* prefer $QTDIR if it is set */ - /* minor hack here, prefer QMAKESPECDIR -cl */ + /* prefer QMAKESPECSDIR -cl */ - if (getenv("QMAKESPECDIR")){ - mkspec_roots << getenv("QMAKESPECDIR"); - } else if (getenv("QTDIR")) { + if (getenv("QTDIR")) { mkspec_roots << getenv("QTDIR"); } mkspec_roots << qInstallPathData(); + + if (getenv("QMAKESPECSDIR")){ + QString mkspec = QString(getenv("QMAKESPECSDIR")) + QDir::separator() + + QDir::separator() + "default"; + if(QFile::exists(mkspec)) + Option::mkfile::qmakespec = mkspec; + } + if(Option::mkfile::qmakespec.isEmpty()) { for(QStringList::Iterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) { QString mkspec = (*it) + QDir::separator() + QString("mkspecs") + QDir::separator() + "default"; if(QFile::exists(mkspec)) { Option::mkfile::qmakespec = mkspec; break; } } - if(Option::mkfile::qmakespec.isEmpty()) { - fprintf(stderr, "QMAKESPEC has not been set, so configuration cannot be deduced.\n"); - return FALSE; - } + } + + if(Option::mkfile::qmakespec.isEmpty()) { + fprintf(stderr, "QMAKESPEC has not been set, so configuration cannot be deduced.\n"); + return FALSE; } if(QDir::isRelativePath(Option::mkfile::qmakespec)) { bool found_mkspec = FALSE; for(QStringList::Iterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) { QString mkspec = (*it) + QDir::separator() + QString("mkspecs") + QDir::separator() + Option::mkfile::qmakespec; if(QFile::exists(mkspec)) { found_mkspec = TRUE; Option::mkfile::qmakespec = mkspec; break; } } if(!found_mkspec) { fprintf(stderr, "Could not find mkspecs for your QMAKESPEC after trying:\n\t%s\n", mkspec_roots.join("\n\t").latin1()); |