author | kergoth <kergoth> | 2002-11-01 16:20:04 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-11-01 16:20:04 (UTC) |
commit | 4c9df59925da5a67d884f8ffb37a263d85948951 (patch) (unidiff) | |
tree | 278796d7d27a06243e584a05f443dbb23eaf028c /qmake | |
parent | ebd6adcd2f72935f0ee7af7485c75c34ac3389a3 (diff) | |
download | opie-4c9df59925da5a67d884f8ffb37a263d85948951.zip opie-4c9df59925da5a67d884f8ffb37a263d85948951.tar.gz opie-4c9df59925da5a67d884f8ffb37a263d85948951.tar.bz2 |
Make qmake obey QMAKESPECSDIR if set.
-rw-r--r-- | qmake/project.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp index ae24193..96cdad8 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp | |||
@@ -438,34 +438,41 @@ QMakeProject::read(QString project, QString) | |||
438 | Option::mkfile::qmakespec = cache["QMAKESPEC"].first(); | 438 | Option::mkfile::qmakespec = cache["QMAKESPEC"].first(); |
439 | } | 439 | } |
440 | } | 440 | } |
441 | /* parse mkspec */ | 441 | /* parse mkspec */ |
442 | QStringList mkspec_roots; | 442 | QStringList mkspec_roots; |
443 | /* prefer $QTDIR if it is set */ | 443 | /* prefer $QTDIR if it is set */ |
444 | /* minor hack here, prefer QMAKESPECDIR -cl */ | 444 | /* prefer QMAKESPECSDIR -cl */ |
445 | 445 | ||
446 | if (getenv("QMAKESPECDIR")){ | 446 | if (getenv("QTDIR")) { |
447 | mkspec_roots << getenv("QMAKESPECDIR"); | ||
448 | } else if (getenv("QTDIR")) { | ||
449 | mkspec_roots << getenv("QTDIR"); | 447 | mkspec_roots << getenv("QTDIR"); |
450 | } | 448 | } |
451 | mkspec_roots << qInstallPathData(); | 449 | mkspec_roots << qInstallPathData(); |
450 | |||
451 | if (getenv("QMAKESPECSDIR")){ | ||
452 | QString mkspec = QString(getenv("QMAKESPECSDIR")) + QDir::separator() + | ||
453 | QDir::separator() + "default"; | ||
454 | if(QFile::exists(mkspec)) | ||
455 | Option::mkfile::qmakespec = mkspec; | ||
456 | } | ||
457 | |||
452 | if(Option::mkfile::qmakespec.isEmpty()) { | 458 | if(Option::mkfile::qmakespec.isEmpty()) { |
453 | for(QStringList::Iterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) { | 459 | for(QStringList::Iterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) { |
454 | QString mkspec = (*it) + QDir::separator() + QString("mkspecs") + | 460 | QString mkspec = (*it) + QDir::separator() + QString("mkspecs") + |
455 | QDir::separator() + "default"; | 461 | QDir::separator() + "default"; |
456 | if(QFile::exists(mkspec)) { | 462 | if(QFile::exists(mkspec)) { |
457 | Option::mkfile::qmakespec = mkspec; | 463 | Option::mkfile::qmakespec = mkspec; |
458 | break; | 464 | break; |
459 | } | 465 | } |
460 | } | 466 | } |
467 | } | ||
468 | |||
461 | if(Option::mkfile::qmakespec.isEmpty()) { | 469 | if(Option::mkfile::qmakespec.isEmpty()) { |
462 | fprintf(stderr, "QMAKESPEC has not been set, so configuration cannot be deduced.\n"); | 470 | fprintf(stderr, "QMAKESPEC has not been set, so configuration cannot be deduced.\n"); |
463 | return FALSE; | 471 | return FALSE; |
464 | } | 472 | } |
465 | } | ||
466 | 473 | ||
467 | if(QDir::isRelativePath(Option::mkfile::qmakespec)) { | 474 | if(QDir::isRelativePath(Option::mkfile::qmakespec)) { |
468 | bool found_mkspec = FALSE; | 475 | bool found_mkspec = FALSE; |
469 | for(QStringList::Iterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) { | 476 | for(QStringList::Iterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) { |
470 | QString mkspec = (*it) + QDir::separator() + QString("mkspecs") + | 477 | QString mkspec = (*it) + QDir::separator() + QString("mkspecs") + |
471 | QDir::separator() + Option::mkfile::qmakespec; | 478 | QDir::separator() + Option::mkfile::qmakespec; |