From 4be7cd09d670064728d3ea508b06bb85e3c71708 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 15 May 2014 10:09:50 +0200 Subject: xcode generator: don't modify or copy QMAKE_INFO_PLIST MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the project has a custom Info.plist assigned to QMAKE_INFO_PLIST, we should leave it as-is without scanning and replacing contents inside it. Since we always copy the file to the build folder at qmake time, any later attempts to modify the source file will not have any effect. A better solution is to just reference the custom plist directly from the Xcode, without modifying it. This change will also stop unixmake2 from assigning the default plist to QMAKE_INFO_PLIST, since we need to know in the xcode generator if the variable was set in the project or not. Task-number: QTBUG-38260 Change-Id: I3c488b2960170c544d94f9db89d3ca95ee290bdd Reviewed-by: Tor Arne Vestbø --- qmake/generators/mac/pbuilder_pbx.cpp | 12 +++++++----- qmake/generators/unix/unixmake2.cpp | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index d44c2ca73f..e1e373787c 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the qmake application of the Qt Toolkit. @@ -1390,9 +1390,13 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) (project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") && project->isActiveConfig("lib_bundle"))) { QString plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString(), Option::output_dir, input_dir); - if (plist.isEmpty()) + if (!plist.isEmpty()) { + if (exists(plist)) + t << "\t\t\t\t" << writeSettings("INFOPLIST_FILE", plist) << ";\n"; + else + warn_msg(WarnLogic, "Could not resolve Info.plist: '%s'. Check if QMAKE_INFO_PLIST points to a valid file.", plist.toLatin1().constData()); + } else { plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE"); - if (exists(plist)) { QFile plist_in_file(plist); if (plist_in_file.open(QIODevice::ReadOnly)) { QTextStream plist_in(&plist_in_file); @@ -1422,8 +1426,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t\t\t\t" << writeSettings("INFOPLIST_FILE", "Info.plist") << ";\n"; } } - } else { - warn_msg(WarnLogic, "Could not resolve Info.plist: '%s'. Check if QMAKE_INFO_PLIST points to a valid file.", plist.toLatin1().constData()); } } diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index a28760015e..d1e363626d 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the qmake application of the Qt Toolkit. @@ -732,6 +732,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) //copy the plist QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST").toQString())), info_plist_out = escapeFilePath(project->first("QMAKE_INFO_PLIST_OUT").toQString()); + if (info_plist.isEmpty()) + info_plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE"); bundledFiles << info_plist_out; QString destdir = info_plist_out.section(Option::dir_sep, 0, -2); t << info_plist_out << ": \n\t"; @@ -1269,8 +1271,6 @@ void UnixMakefileGenerator::init2() if(plist.isEmpty()) plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE"); if(exists(Option::fixPathToLocalOS(plist))) { - if(project->isEmpty("QMAKE_INFO_PLIST")) - project->values("QMAKE_INFO_PLIST").append(plist); project->values("QMAKE_INFO_PLIST_OUT").append(project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Info.plist"); -- cgit v1.2.3