From bd8c18cca5cd7f4c9901edb5f70752005b3fac9a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 25 Sep 2014 20:32:18 +0200 Subject: fix Info.plist location in framework bundles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to Apple's documentation [1], framework bundles don't have a 'Contents' folder. Instead, each version folder gets a 'Resources' folder which contains the Info.plist file, and which is also symlinked at the top-level framework folder. [1]: https://developer.apple.com/library/mac/documentation/macosx/conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html Task-number: QTBUG-32895 Change-Id: I5e55cc097b179012add0ceb7c567dace8e282895 Reviewed-by: Morten Johan Sørvig --- qmake/generators/unix/unixmake2.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 27ffb9f40d..8bc5b00fd9 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -739,7 +739,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) info_plist.toLatin1().constData()); break; } - QString info_plist_out = escapeFilePath(bundle_dir + "Contents/Info.plist"); + bool isApp = (project->first("TEMPLATE") == "app"); + QString info_plist_out = escapeFilePath( + bundle_dir + (isApp ? "Contents/Info.plist" + : "Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") + + "/Resources/Info.plist")); bundledFiles << info_plist_out; alldeps << info_plist_out; QString destdir = info_plist_out.section(Option::dir_sep, 0, -2); @@ -756,7 +760,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "; - if (project->first("TEMPLATE") == "app") { + if (isApp) { QString icon = fileFixify(var("ICON")); QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString(); if (bundlePrefix.isEmpty()) @@ -788,6 +792,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << "@$(COPY_FILE) " << escapeFilePath(icon) << " " << icon_path << endl; } } else { + symlinks[bundle_dir + "Resources"] = "Versions/Current/Resources"; t << "@$(DEL_FILE) " << info_plist_out << "\n\t" << "@sed "; foreach (const ProString &arg, commonSedArgs) -- cgit v1.2.3