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-14 11:26:53 (GMT)
commitb6b3f7b60ac3a59bc083e38e78b087b20f003bb6 (patch)
treefd8872e2d8963149da186f3859377b345cb835c2 /qmake
parent2ac0b4390164e7d92b53b0b0f55a82a9a054ee91 (diff)
downloadQt-b6b3f7b60ac3a59bc083e38e78b087b20f003bb6.zip
Qt-b6b3f7b60ac3a59bc083e38e78b087b20f003bb6.tar.gz
Qt-b6b3f7b60ac3a59bc083e38e78b087b20f003bb6.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 c1ab60b..7424d1d 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;