summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorThomas Zander <t.zander@nokia.com>2010-01-14 10:48:01 (GMT)
committerThomas Zander <t.zander@nokia.com>2010-01-19 14:37:47 (GMT)
commit2dd723f5c66a00ebb1a70e956d45cf97b04e7cdd (patch)
treefe4473655aa63f6bf44fc5521e3aea0d1dea03c3 /qmake
parentc0e094d924d6fc095f52b336f02db5d41f71ab48 (diff)
downloadQt-2dd723f5c66a00ebb1a70e956d45cf97b04e7cdd.zip
Qt-2dd723f5c66a00ebb1a70e956d45cf97b04e7cdd.tar.gz
Qt-2dd723f5c66a00ebb1a70e956d45cf97b04e7cdd.tar.bz2
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 '..'
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/makefile.cpp8
1 files 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, QList<MakefileGenerator::SubT
//qmake it
if(!subtarget->profile.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, QList<MakefileGenerator::SubT
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;