From fcfd06409768916ef10c7048a87b2328ec5d45f7 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 14 Feb 2011 18:33:27 +0100 Subject: qmake/Mac: replace @SHORT_VERSION@ in QMAKE_INFO_PLIST file not only for libs Task-number: QTBUG-7993 Reviewed-by: Marius Storm-Olsen --- qmake/generators/mac/pbuilder_pbx.cpp | 2 ++ qmake/generators/unix/unixmake2.cpp | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 0ec946e..19667cd 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1272,6 +1272,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) plist_in_text = plist_in_text.replace("@EXECUTABLE@", project->first("QMAKE_ORIG_TARGET")); } else { plist_in_text = plist_in_text.replace("@LIBRARY@", project->first("QMAKE_ORIG_TARGET")); + } + if (!project->values("VERSION").isEmpty()) { plist_in_text = plist_in_text.replace("@SHORT_VERSION@", project->first("VER_MAJ") + "." + project->first("VER_MIN")); } diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 5ea13f4..212f8bd 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -712,11 +712,18 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << info_plist_out << ": " << "\n\t"; if(!destdir.isEmpty()) t << mkdir_p_asstring(destdir) << "\n\t"; + QStringList commonSedArgs; + if (!project->values("VERSION").isEmpty()) + commonSedArgs << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." << project->first("VER_MIN") << ",g\" "; + commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? + QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "; if(project->first("TEMPLATE") == "app") { QString icon = fileFixify(var("ICON")); t << "@$(DEL_FILE) " << info_plist_out << "\n\t" - << "@sed " - << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" " + << "@sed "; + foreach (const QString &arg, commonSedArgs) + t << arg; + t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",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\" " @@ -732,9 +739,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } } else { t << "@$(DEL_FILE) " << info_plist_out << "\n\t" - << "@sed " - << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" " - << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." << project->first("VER_MIN") << ",g\" " + << "@sed "; + foreach (const QString &arg, commonSedArgs) + t << arg; + t << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" " << "-e \"s,@TYPEINFO@," << (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " -- cgit v0.12