diff --git a/mkspecs/macx-clang-32/Info.plist.lib b/mkspecs/macx-clang-32/Info.plist.lib
index 2a44d1721ec1d704125950074b5bb6902b7a7790..7cbdb9af12984692ee84ab7894eea56ee1dadac0 100644
--- a/mkspecs/macx-clang-32/Info.plist.lib
+++ b/mkspecs/macx-clang-32/Info.plist.lib
@@ -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>
diff --git a/mkspecs/macx-clang/Info.plist.lib b/mkspecs/macx-clang/Info.plist.lib
index 2a44d1721ec1d704125950074b5bb6902b7a7790..7cbdb9af12984692ee84ab7894eea56ee1dadac0 100644
--- a/mkspecs/macx-clang/Info.plist.lib
+++ b/mkspecs/macx-clang/Info.plist.lib
@@ -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>
diff --git a/mkspecs/macx-g++-32/Info.plist.lib b/mkspecs/macx-g++-32/Info.plist.lib
index 2a44d1721ec1d704125950074b5bb6902b7a7790..7cbdb9af12984692ee84ab7894eea56ee1dadac0 100644
--- a/mkspecs/macx-g++-32/Info.plist.lib
+++ b/mkspecs/macx-g++-32/Info.plist.lib
@@ -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>
diff --git a/mkspecs/macx-g++/Info.plist.lib b/mkspecs/macx-g++/Info.plist.lib
index 2a44d1721ec1d704125950074b5bb6902b7a7790..7cbdb9af12984692ee84ab7894eea56ee1dadac0 100644
--- a/mkspecs/macx-g++/Info.plist.lib
+++ b/mkspecs/macx-g++/Info.plist.lib
@@ -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>
diff --git a/mkspecs/macx-g++40/Info.plist.lib b/mkspecs/macx-g++40/Info.plist.lib
index 2a44d1721ec1d704125950074b5bb6902b7a7790..7cbdb9af12984692ee84ab7894eea56ee1dadac0 100644
--- a/mkspecs/macx-g++40/Info.plist.lib
+++ b/mkspecs/macx-g++40/Info.plist.lib
@@ -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>
diff --git a/mkspecs/macx-g++42/Info.plist.lib b/mkspecs/macx-g++42/Info.plist.lib
index 2a44d1721ec1d704125950074b5bb6902b7a7790..7cbdb9af12984692ee84ab7894eea56ee1dadac0 100644
--- a/mkspecs/macx-g++42/Info.plist.lib
+++ b/mkspecs/macx-g++42/Info.plist.lib
@@ -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>
diff --git a/mkspecs/macx-icc/Info.plist.lib b/mkspecs/macx-icc/Info.plist.lib
index 2a44d1721ec1d704125950074b5bb6902b7a7790..7cbdb9af12984692ee84ab7894eea56ee1dadac0 100644
--- a/mkspecs/macx-icc/Info.plist.lib
+++ b/mkspecs/macx-icc/Info.plist.lib
@@ -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>
diff --git a/mkspecs/macx-llvm/Info.plist.lib b/mkspecs/macx-llvm/Info.plist.lib
index 2a44d1721ec1d704125950074b5bb6902b7a7790..7cbdb9af12984692ee84ab7894eea56ee1dadac0 100644
--- a/mkspecs/macx-llvm/Info.plist.lib
+++ b/mkspecs/macx-llvm/Info.plist.lib
@@ -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>
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index d9b0e10057f68d3ba9f33e880f471ab490ac7638..8270f02febcd615248ca9c97eb971dacc40d26ef 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -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\" "