diff options
-rw-r--r-- | qmake/generators/mac/pbuilder_pbx.cpp | 10 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 18 |
2 files changed, 23 insertions, 5 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index b53b862b87..09581879ef 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1480,9 +1480,15 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) plist_in_text.replace(QLatin1String("@ICON@"), (project->isEmpty("ICON") ? QString("") : project->first("ICON").toQString().section(Option::dir_sep, -1))); if (project->first("TEMPLATE") == "app") { - plist_in_text.replace(QLatin1String("@EXECUTABLE@"), project->first("QMAKE_ORIG_TARGET").toQString()); + ProString app_bundle_name = project->first("QMAKE_APPLICATION_BUNDLE_NAME"); + if (app_bundle_name.isEmpty()) + app_bundle_name = project->first("QMAKE_ORIG_TARGET"); + plist_in_text.replace(QLatin1String("@EXECUTABLE@"), app_bundle_name.toQString()); } else { - plist_in_text.replace(QLatin1String("@LIBRARY@"), project->first("QMAKE_ORIG_TARGET").toQString()); + ProString lib_bundle_name = project->first("QMAKE_FRAMEWORK_BUNDLE_NAME"); + if (lib_bundle_name.isEmpty()) + lib_bundle_name = project->first("QMAKE_ORIG_TARGET"); + plist_in_text.replace(QLatin1String("@LIBRARY@"), lib_bundle_name.toQString()); } QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString(); if (bundlePrefix.isEmpty()) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 5d9bcf4ec2..2d6885076d 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -822,14 +822,22 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) commonSedArgs << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" "; if (!isFramework) { + ProString app_bundle_name = var("QMAKE_APPLICATION_BUNDLE_NAME"); + if (app_bundle_name.isEmpty()) + app_bundle_name = var("QMAKE_ORIG_TARGET"); + + ProString plugin_bundle_name = var("QMAKE_PLUGIN_BUNDLE_NAME"); + if (plugin_bundle_name.isEmpty()) + plugin_bundle_name = var("QMAKE_ORIG_TARGET"); + QString icon = fileFixify(var("ICON")); t << "@$(DEL_FILE) " << info_plist_out << "\n\t" << "@sed "; for (const ProString &arg : qAsConst(commonSedArgs)) t << arg; t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" " - << "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" " - << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" " + << "-e \"s,@EXECUTABLE@," << app_bundle_name << ",g\" " + << "-e \"s,@LIBRARY@," << plugin_bundle_name << ",g\" " << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " << "" << info_plist << " >" << info_plist_out << endl; @@ -846,13 +854,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << "@$(COPY_FILE) " << escapeFilePath(icon) << ' ' << icon_path_f << endl; } } else { + ProString lib_bundle_name = var("QMAKE_FRAMEWORK_BUNDLE_NAME"); + if (lib_bundle_name.isEmpty()) + lib_bundle_name = var("QMAKE_ORIG_TARGET"); + if (!isShallowBundle) symlinks[bundle_dir + "Resources"] = "Versions/Current/Resources"; t << "@$(DEL_FILE) " << info_plist_out << "\n\t" << "@sed "; for (const ProString &arg : qAsConst(commonSedArgs)) t << arg; - t << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" " + t << "-e \"s,@LIBRARY@," << lib_bundle_name << ",g\" " << "-e \"s,@TYPEINFO@," << (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " |