From 4849037851b210507df63eb4aed7e467c834be62 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 25 Sep 2014 16:46:15 +0200 Subject: nest bundle-related conditionals for clarity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I97f9d87cb5a114bf4764f13f0fd0d22e9b4da96f Reviewed-by: Morten Johan Sørvig --- qmake/generators/unix/unixmake2.cpp | 39 +++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 55a94bef90..77170c3e89 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -702,26 +702,27 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << "@$(QMAKE) -prl " << buildArgs() << " " << project->projectFile() << endl; } - if(!project->first("QMAKE_PKGINFO").isEmpty()) { - ProString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO")); - QString destdir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents"; - t << pkginfo << ": \n\t"; - if(!destdir.isEmpty()) + if (!project->isEmpty("QMAKE_BUNDLE")) { + if (!project->first("QMAKE_PKGINFO").isEmpty()) { + ProString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO")); + QString destdir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents"; + t << pkginfo << ": \n\t"; + if (!destdir.isEmpty()) + t << mkdir_p_asstring(destdir) << "\n\t"; + t << "@$(DEL_FILE) " << pkginfo << "\n\t" + << "@echo \"APPL" + << (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") + ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) + << "\" >" << pkginfo << endl; + } + if (!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) { + ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE")); + bundledFiles << resources; + QString destdir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources"; + t << resources << ": \n\t"; t << mkdir_p_asstring(destdir) << "\n\t"; - t << "@$(DEL_FILE) " << pkginfo << "\n\t" - << "@echo \"APPL" - << (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) - << "\" >" << pkginfo << endl; - } - if(!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) { - ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE")); - bundledFiles << resources; - QString destdir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources"; - t << resources << ": \n\t"; - t << mkdir_p_asstring(destdir) << "\n\t"; - t << "@touch " << resources << "\n\t\n"; - } - if(!project->isEmpty("QMAKE_BUNDLE")) { + t << "@touch " << resources << "\n\t\n"; + } //copy the plist QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST").toQString())), info_plist_out = escapeFilePath(project->first("QMAKE_INFO_PLIST_OUT").toQString()); -- cgit v1.2.3