Skip to content

Commit

Permalink
Add CFBundleIdentifier to the bundle Info.plist's
Browse files Browse the repository at this point in the history
Refactor the current app CFBundleIdentifier support:
handle frameworks as well. Add @BUNDLEIDENTIFIER@
placeholder to the OS X info.plist.lib templates. 

This means the Qt frameworks will now get a valid
CFBundleIdentifier entry the same way as app bundles:
by extracting the identifier prefix from Xcode settings
and appending framework name.

Task-number: QTBUG-32896
Change-Id: Ica8f28332a88e37a823c46fca7a2c373157af020
Reviewed-by: Tor Arne Vestbø <[email protected]>
Reviewed-by: Oswald Buddenhagen <[email protected]>
  • Loading branch information
Morten Johan Sørvig authored and Jani Heikkinen committed Nov 10, 2014
1 parent 6dd3f08 commit ade8e0f
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 9 deletions.
2 changes: 2 additions & 0 deletions mkspecs/macx-clang-32/Info.plist.lib
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict>
Expand Down
2 changes: 2 additions & 0 deletions mkspecs/macx-clang/Info.plist.lib
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict>
Expand Down
2 changes: 2 additions & 0 deletions mkspecs/macx-g++-32/Info.plist.lib
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict>
Expand Down
2 changes: 2 additions & 0 deletions mkspecs/macx-g++/Info.plist.lib
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict>
Expand Down
2 changes: 2 additions & 0 deletions mkspecs/macx-g++40/Info.plist.lib
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict>
Expand Down
2 changes: 2 additions & 0 deletions mkspecs/macx-g++42/Info.plist.lib
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict>
Expand Down
2 changes: 2 additions & 0 deletions mkspecs/macx-icc/Info.plist.lib
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict>
Expand Down
2 changes: 2 additions & 0 deletions mkspecs/macx-llvm/Info.plist.lib
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@LIBRARY@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLEIDENTIFIER@</string>
<key>NOTE</key>
<string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
</dict>
Expand Down
22 changes: 13 additions & 9 deletions qmake/generators/unix/unixmake2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,22 +814,26 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ?
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" ";

QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString();
if (bundlePrefix.isEmpty())
bundlePrefix = "com.yourcompany";
if (bundlePrefix.endsWith("."))
bundlePrefix.chop(1);
QString bundleIdentifier = bundlePrefix + "." + var("QMAKE_BUNDLE");
if (bundleIdentifier.endsWith(".app"))
bundleIdentifier.chop(4);
if (bundleIdentifier.endsWith(".framework"))
bundleIdentifier.chop(10);
commonSedArgs << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" ";

if (isApp) {
QString icon = fileFixify(var("ICON"));
QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString();
if (bundlePrefix.isEmpty())
bundlePrefix = "com.yourcompany";
if (bundlePrefix.endsWith("."))
bundlePrefix.chop(1);
QString bundleIdentifier = bundlePrefix + "." + var("QMAKE_BUNDLE");
if (bundleIdentifier.endsWith(".app"))
bundleIdentifier.chop(4);
t << "@$(DEL_FILE) " << info_plist_out << "\n\t"
<< "@sed ";
foreach (const ProString &arg, commonSedArgs)
t << arg;
t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" "
<< "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" "
<< "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" "
<< "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ?
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "
Expand Down

0 comments on commit ade8e0f

Please sign in to comment.