path: root/qmake
diff options
authorTor Arne Vestbø <>2012-12-05 13:33:59 +0100
committerTor Arne Vestbø <>2013-02-26 13:13:17 +0100
commit3cc738dfc79cca0cf415184ab1db0cc7a1c069d0 (patch)
tree2f9bea97546c0b0d6aaba539a627f5c80d81f382 /qmake
parent883efa10cdfd81cc4ccbcca55d42a454877d146e (diff)
qmake: Don't treat .xcodeproj directories as OUT_PWD when passed with -o
The Xcode generator creates a makefile for running 'make qmake', and the makefile passes -o to ensure it writes to the same Xcode project. This fails when qmake then treats -o foo.xcodeproj/project.xcproj as not only setting the output filename, but also the output directory to foo.xcodeproj, which results in the Xcode project trying to reference files relative to this directory, such as '../main.cpp'. Unfortunatly the output filename parsing happens too early for us to know whether or not the generator is Xcode, so we just have to assume that a certain combination of output filename and directories means we are generating an Xcode project. Change-Id: I0901d4db995f287c35cbbbd015683d5abda6d0f5 Reviewed-by: Richard Moe Gustavsen <>
Diffstat (limited to 'qmake')
1 files changed, 5 insertions, 0 deletions
diff --git a/qmake/main.cpp b/qmake/main.cpp
index 5f9fb05449..6ef0707da9 100644
--- a/qmake/main.cpp
+++ b/qmake/main.cpp
@@ -116,6 +116,11 @@ int runQMake(int argc, char **argv)
if(!tmp_dir.isEmpty() && QFile::exists(tmp_dir))
dir = tmp_dir;
+#ifdef Q_OS_MAC
+ if (fi.fileName().endsWith(QStringLiteral(".pbxproj"))
+ && dir.endsWith(QStringLiteral(".xcodeproj")))
+ dir += QStringLiteral("/..");
if(!dir.isNull() && dir != ".")
Option::output_dir = dir;