summaryrefslogtreecommitdiff
path: root/qmake
Side-by-side diff
Diffstat (limited to 'qmake') (more/less context) (ignore whitespace changes)
-rw-r--r--qmake/project.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 96cdad8..44eb503 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -403,97 +403,97 @@ QMakeProject::read(QString file, QMap<QString, QStringList> &place)
if(!using_stdin)
qfile.close();
}
parser = pi;
return ret;
}
bool
QMakeProject::read(QString project, QString)
{
if(cfile.isEmpty()) {
// hack to get the Option stuff in there
base_vars["QMAKE_EXT_CPP"] = Option::cpp_ext;
base_vars["QMAKE_EXT_H"] = Option::h_ext;
/* parse the cache */
if(Option::mkfile::do_cache) {
if(Option::mkfile::cachefile.isEmpty()) { //find it as it has not been specified
QString dir = QDir::convertSeparators(Option::output_dir);
while(!QFile::exists((Option::mkfile::cachefile = dir +
QDir::separator() + ".qmake.cache"))) {
dir = dir.left(dir.findRev(QDir::separator()));
if(dir.isEmpty() || dir.find(QDir::separator()) == -1) {
Option::mkfile::cachefile = "";
break;
}
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 */
/* prefer QMAKESPECSDIR -cl */
if (getenv("QTDIR")) {
mkspec_roots << getenv("QTDIR");
}
mkspec_roots << qInstallPathData();
- if (getenv("QMAKESPECSDIR")){
+ if (Option::mkfile::qmakespec.isEmpty() && 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(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());
return FALSE;
}
}
/* parse qmake configuration */
QString spec = Option::mkfile::qmakespec + QDir::separator() + "qmake.conf";
debug_msg(1, "QMAKESPEC conf: reading %s", spec.latin1());
if(!read(spec, base_vars)) {
fprintf(stderr, "Failure to read QMAKESPEC conf file %s.\n", spec.latin1());
return FALSE;
}
if(Option::mkfile::do_cache && !Option::mkfile::cachefile.isEmpty()) {