From 3cc738dfc79cca0cf415184ab1db0cc7a1c069d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 5 Dec 2012 13:33:59 +0100 Subject: 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 --- qmake/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'qmake/main.cpp') 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("/.."); +#endif if(!dir.isNull() && dir != ".") Option::output_dir = dir; if(QDir::isRelativePath(Option::output_dir)) -- cgit v1.2.3