diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index 8c10d7d306..e3fa39c7e4 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -79,7 +79,7 @@ public: virtual bool init(); virtual int type() const { return BUILDSMETATYPE; } - virtual bool write(const QString &); + virtual bool write(); }; void @@ -149,7 +149,7 @@ BuildsMetaMakefileGenerator::init() } bool -BuildsMetaMakefileGenerator::write(const QString &oldpwd) +BuildsMetaMakefileGenerator::write() { Build *glue = 0; if(!makefiles.isEmpty() && !makefiles.first()->build.isNull()) { @@ -181,7 +181,6 @@ BuildsMetaMakefileGenerator::write(const QString &oldpwd) if(Option::output.fileName().isEmpty() && Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE) Option::output.setFileName(project->first("QMAKE_MAKEFILE").toQString()); - Option::output_dir = oldpwd; QString build_name = build->name; if(!build->build.isEmpty()) { if(!build_name.isEmpty()) @@ -268,7 +267,7 @@ public: virtual bool init(); virtual int type() const { return SUBDIRSMETATYPE; } - virtual bool write(const QString &); + virtual bool write(); }; bool @@ -349,7 +348,7 @@ SubdirsMetaMakefileGenerator::init() } else { const QString output_name = Option::output.fileName(); Option::output.setFileName(sub->output_file); - hasError |= !sub->makefile->write(sub->output_dir); + hasError |= !sub->makefile->write(); delete sub; qmakeClearCaches(); sub = 0; @@ -378,7 +377,7 @@ SubdirsMetaMakefileGenerator::init() } bool -SubdirsMetaMakefileGenerator::write(const QString &oldpwd) +SubdirsMetaMakefileGenerator::write() { bool ret = true; const QString &pwd = qmake_getpwd(); @@ -397,10 +396,7 @@ SubdirsMetaMakefileGenerator::write(const QString &oldpwd) printf("Writing %s\n", QDir::cleanPath(Option::output_dir+"/"+ Option::output.fileName()).toLatin1().constData()); } - QString writepwd = Option::fixPathToLocalOS(qmake_getpwd()); - if(!writepwd.startsWith(Option::fixPathToLocalOS(oldpwd))) - writepwd = oldpwd; - if(!(ret = subs.at(i)->makefile->write(writepwd))) + if (!(ret = subs.at(i)->makefile->write())) break; //restore because I'm paranoid qmake_setpwd(pwd); diff --git a/qmake/generators/metamakefile.h b/qmake/generators/metamakefile.h index 85106a674d..aff2f422a6 100644 --- a/qmake/generators/metamakefile.h +++ b/qmake/generators/metamakefile.h @@ -69,7 +69,7 @@ public: virtual bool init() = 0; virtual int type() const { return -1; } - virtual bool write(const QString &oldpwd) = 0; + virtual bool write() = 0; }; QT_END_NAMESPACE diff --git a/qmake/main.cpp b/qmake/main.cpp index 5f9fb05449..e339239289 100644 --- a/qmake/main.cpp +++ b/qmake/main.cpp @@ -187,7 +187,7 @@ int runQMake(int argc, char **argv) if (!success) exit_val = 3; - if(mkfile && !mkfile->write(oldpwd)) { + if (mkfile && !mkfile->write()) { if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) fprintf(stderr, "Unable to generate project file.\n"); else