From c9568da9697adc50b1417dff3e040aefb934522b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 11 Jul 2013 15:43:32 +0200 Subject: don't install mac bundles atomically ... as that causes debug+release installs to overwrite each other's postprocessed files. introduces CONFIG+=sliced_bundle, which instructs qmake to create file-by-file install commands. we don't know whether people are not putting files outside qmake's knowledge into the bundle build dir, so this mode is not necessarily backwards-compatible, and thus off by default. Task-number: QTBUG-28336 Change-Id: I23e90985ccd3311f0237ed61aadca6d7ed8325b7 Reviewed-by: Joerg Bornemann --- qmake/generators/unix/unixmake2.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'qmake/generators/unix/unixmake2.cpp') diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 8d63ccdf2a..e4d33e2d4e 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -118,6 +118,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) (!project->isActiveConfig("staticlib")))), src_incremental=false; + ProStringList &bundledFiles = project->values("QMAKE_BUNDLED_FILES"); + t << "####### Compiler, tools and options\n\n"; t << "CC = " << var("QMAKE_CC") << endl; t << "CXX = " << var("QMAKE_CXX") << endl; @@ -555,6 +557,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; } else if(!project->isEmpty("QMAKE_BUNDLE")) { + QString currentLink = destdir + "Versions/Current"; + bundledFiles << currentLink << destdir + "$(TARGET)"; t << "\n\t" << "-$(DEL_FILE) $(TARGET) $(TARGET0) $(DESTDIR)$(TARGET0)\n\t" << var("QMAKE_LINK_SHLIB_CMD") << "\n\t" @@ -563,9 +567,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGET0)`\"", false) << "\n\t" << varGlue("QMAKE_LN_SHLIB", "-", " ", " Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t" - << "-$(DEL_FILE) " << destdir << "Versions/Current\n\t" + << "-$(DEL_FILE) " << currentLink << "\n\t" << varGlue("QMAKE_LN_SHLIB","-"," ", " " + project->first("QMAKE_FRAMEWORK_VERSION") + - " " + destdir + "Versions/Current") << "\n\t"; + " " + currentLink) << "\n\t"; if(!project->isEmpty("QMAKE_POST_LINK")) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; @@ -703,6 +707,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } if(!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) { ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE")); + bundledFiles << resources; QString destdir = escapeFilePath(project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources"); t << resources << ": \n\t"; t << mkdir_p_asstring(destdir) << "\n\t"; @@ -712,6 +717,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) //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()); + bundledFiles << info_plist_out; QString destdir = info_plist_out.section(Option::dir_sep, 0, -2); t << info_plist_out << ": \n\t"; if(!destdir.isEmpty()) @@ -736,6 +742,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(!project->isEmpty("ICON")) { QString dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources/"; const QString icon_path = escapeFilePath(dir + icon.section(Option::dir_sep, -1)); + bundledFiles << icon_path; t << icon_path << ": " << icon << "\n\t" << mkdir_p_asstring(dir) << "\n\t" << "@$(DEL_FILE) " << icon_path << "\n\t" @@ -764,7 +771,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if (!project->isEmpty(vkey)) { QString version = project->first(vkey) + "/" + project->first("QMAKE_FRAMEWORK_VERSION") + "/"; - t << Option::fixPathToLocalOS(path + project->first(pkey)) << ": \n\t" + QString link = Option::fixPathToLocalOS(path + project->first(pkey)); + bundledFiles << link; + t << link << ": \n\t" << mkdir_p_asstring(path) << "\n\t" << "@$(SYMLINK) " << version << project->first(pkey) << " " << path << endl; path += version; @@ -778,6 +787,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) src = fn; src = escapeFilePath(src); const QString dst = escapeFilePath(path + Option::dir_sep + fileInfo(fn).fileName()); + bundledFiles << dst; t << dst << ": " << src << "\n\t" << mkdir_p_asstring(path) << "\n\t"; QFileInfo fi(fileInfo(fn)); -- cgit v1.2.3