From 2dd723f5c66a00ebb1a70e956d45cf97b04e7cdd Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Thu, 14 Jan 2010 11:48:01 +0100 Subject: Better fix for build!=src Makefile generation Make sure we always use the absolute path to the pro file so it will just work from either source or build dir. This fixes the usecase where qmake generated a relative path starting with '..' --- qmake/generators/makefile.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index b2468d7..aaada6d 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2412,16 +2412,14 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListprofile.isEmpty()) { QString out = subtarget->makefile; - QString in = fileFixify(in_directory + subtarget->profile, in_directory); - if(in.startsWith(in_directory)) - in = in.mid(in_directory.length()); + QString in = fileFixify(in_directory + subtarget->profile, out_directory, QString(), FileFixifyAbsolute); if(out.startsWith(in_directory)) out = out.mid(in_directory.length()); t << mkfile << ": " << "\n\t"; if(!in_directory.isEmpty()) { t << mkdir_p_asstring(out_directory) << out_directory_cdin - << "$(QMAKE) " << subtarget->in_directory << QDir::separator() << in << buildArgs(in_directory) << " -o " << out + << "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out << in_directory_cdout << endl; } else { t << "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out << endl; @@ -2433,7 +2431,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListin_directory << QDir::separator() << in << buildArgs(in_directory) << " -o " << out + << "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out << in_directory_cdout << endl; } else { t << "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out << endl; -- cgit v0.12