[Cmake-commits] CMake branch, master, updated. v3.8.0-939-g75d91e9

Kitware Robot kwrobot at kitware.com
Tue Apr 25 09:15:02 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  75d91e9c85a26796a291a8fb4ba289802313f917 (commit)
       via  58cf9d417e8b3d4d76597b9950a5af4860d3512c (commit)
       via  03628bb699956d92676c610e9a24d159aa591900 (commit)
      from  60e48295ae95535af7e245f308cf204a3ca9680d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=75d91e9c85a26796a291a8fb4ba289802313f917
commit 75d91e9c85a26796a291a8fb4ba289802313f917
Merge: 60e4829 58cf9d4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 25 13:05:33 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Apr 25 09:05:37 2017 -0400

    Merge topic 'wix-attributes-patch'
    
    58cf9d41 wix: adds ability to modify attributes with patch
    03628bb6 wix: fix spelling error in function name
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !742


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=58cf9d417e8b3d4d76597b9950a5af4860d3512c
commit 58cf9d417e8b3d4d76597b9950a5af4860d3512c
Author:     Keith Holman <keith.holman at windriver.com>
AuthorDate: Fri Apr 21 10:42:35 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Apr 24 10:06:45 2017 -0400

    wix: adds ability to modify attributes with patch
    
    Adds the ability to attributes to generated XML files for features with
    the WiX patch system.  To modify attributes additional attributes may be
    added within the 'CPackWixFragment' xml tag.
    
    Fixes: #16813
    Signed-off-by: Keith Holman <keith.holman at windriver.com>

diff --git a/Help/release/dev/wix-attributes-patch.rst b/Help/release/dev/wix-attributes-patch.rst
new file mode 100644
index 0000000..e68d9f2
--- /dev/null
+++ b/Help/release/dev/wix-attributes-patch.rst
@@ -0,0 +1,7 @@
+wix-attributes-patch
+--------------------
+
+* The patching system within the :module:`CPackWIX` module now allows the
+  ability to set additional attributes.  This can be done by specifying
+  addional attributes with the ``CPackWiXFragment`` XML tag after the
+  ``Id`` attribute.  See the :variable:`CPACK_WIX_PATCH_FILE` variable.
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 213a055..274dfd0 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -906,12 +906,12 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitions(
       directoryDefinitions.BeginElement("Directory");
       directoryDefinitions.AddAttribute("Id", subDirectoryId);
       directoryDefinitions.AddAttribute("Name", fileName);
+      this->Patch->ApplyFragment(subDirectoryId, directoryDefinitions);
 
       AddDirectoryAndFileDefinitions(
         fullPath, subDirectoryId, directoryDefinitions, fileDefinitions,
         featureDefinitions, packageExecutables, desktopExecutables, shortcuts);
 
-      this->Patch->ApplyFragment(subDirectoryId, directoryDefinitions);
       directoryDefinitions.EndElement("Directory");
     } else {
       cmInstalledFile const* installedFile = this->GetInstalledFile(
diff --git a/Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx
index 79a9fdd..0be4377 100644
--- a/Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx
+++ b/Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx
@@ -44,6 +44,8 @@ void cmWIXFeaturesSourceWriter::EmitFeatureForComponentGroup(
   AddAttributeUnlessEmpty("Title", group.DisplayName);
   AddAttributeUnlessEmpty("Description", group.Description);
 
+  patch.ApplyFragment("CM_G_" + group.Name, *this);
+
   for (std::vector<cmCPackComponentGroup*>::const_iterator i =
          group.Subgroups.begin();
        i != group.Subgroups.end(); ++i) {
@@ -56,8 +58,6 @@ void cmWIXFeaturesSourceWriter::EmitFeatureForComponentGroup(
     EmitFeatureForComponent(**i, patch);
   }
 
-  patch.ApplyFragment("CM_G_" + group.Name, *this);
-
   EndElement("Feature");
 }
 
diff --git a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
index 7aa1212..b4cd1a3 100644
--- a/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
+++ b/Source/CPack/WiX/cmWIXFilesSourceWriter.cxx
@@ -136,6 +136,7 @@ std::string cmWIXFilesSourceWriter::EmitComponentFile(
     }
   }
 
+  patch.ApplyFragment(componentId, *this);
   BeginElement("File");
   AddAttribute("Id", fileId);
   AddAttribute("Source", filePath);
@@ -147,16 +148,15 @@ std::string cmWIXFilesSourceWriter::EmitComponentFile(
   if (!(fileMode & S_IWRITE)) {
     AddAttribute("ReadOnly", "yes");
   }
+  patch.ApplyFragment(fileId, *this);
 
   if (installedFile) {
     cmWIXAccessControlList acl(Logger, *installedFile, *this);
     acl.Apply();
   }
 
-  patch.ApplyFragment(fileId, *this);
   EndElement("File");
 
-  patch.ApplyFragment(componentId, *this);
   EndElement("Component");
   EndElement("DirectoryRef");
 
diff --git a/Source/CPack/WiX/cmWIXPatch.cxx b/Source/CPack/WiX/cmWIXPatch.cxx
index 3a7dbfd..287a644 100644
--- a/Source/CPack/WiX/cmWIXPatch.cxx
+++ b/Source/CPack/WiX/cmWIXPatch.cxx
@@ -29,7 +29,11 @@ void cmWIXPatch::ApplyFragment(std::string const& id,
     return;
 
   const cmWIXPatchElement& fragment = i->second;
-
+  for (cmWIXPatchElement::attributes_t::const_iterator attr_i =
+         fragment.attributes.begin();
+       attr_i != fragment.attributes.end(); ++attr_i) {
+    writer.AddAttribute(attr_i->first, attr_i->second);
+  }
   this->ApplyElementChildren(fragment, writer);
 
   Fragments.erase(i);
diff --git a/Source/CPack/WiX/cmWIXPatchParser.cxx b/Source/CPack/WiX/cmWIXPatchParser.cxx
index 7f2ae19..0dcc74a 100644
--- a/Source/CPack/WiX/cmWIXPatchParser.cxx
+++ b/Source/CPack/WiX/cmWIXPatchParser.cxx
@@ -72,9 +72,11 @@ void cmWIXPatchParser::StartElement(const std::string& name, const char** atts)
 
 void cmWIXPatchParser::StartFragment(const char** attributes)
 {
+  cmWIXPatchElement* new_element = CM_NULLPTR;
+  /* find the id of for fragment */
   for (size_t i = 0; attributes[i]; i += 2) {
-    std::string key = attributes[i];
-    std::string value = attributes[i + 1];
+    const std::string key = attributes[i];
+    const std::string value = attributes[i + 1];
 
     if (key == "Id") {
       if (Fragments.find(value) != Fragments.end()) {
@@ -83,10 +85,22 @@ void cmWIXPatchParser::StartFragment(const char** attributes)
         ReportValidationError(tmp.str());
       }
 
-      ElementStack.push_back(&Fragments[value]);
-    } else {
-      ReportValidationError(
-        "The only allowed 'CPackWixFragment' attribute is 'Id'");
+      new_element = &Fragments[value];
+      ElementStack.push_back(new_element);
+    }
+  }
+
+  /* add any additional attributes for the fragement */
+  if (!new_element) {
+    ReportValidationError("No 'Id' specified for 'CPackWixFragment' element");
+  } else {
+    for (size_t i = 0; attributes[i]; i += 2) {
+      const std::string key = attributes[i];
+      const std::string value = attributes[i + 1];
+
+      if (key != "Id") {
+        new_element->attributes[key] = value;
+      }
     }
   }
 }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=03628bb699956d92676c610e9a24d159aa591900
commit 03628bb699956d92676c610e9a24d159aa591900
Author:     Keith Holman <keith.holman at windriver.com>
AuthorDate: Fri Apr 21 12:14:07 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Apr 24 10:04:51 2017 -0400

    wix: fix spelling error in function name
    
    The function "AddDirectoryAndFileDefinitions" was missing the last "i"
    in the function name.  This patch corrects the spelling so that the
    function can be found easier when searching through the source code.
    
    Signed-off-by: Keith Holman <keith.holman at windriver.com>

diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 2df23fd..213a055 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -677,10 +677,10 @@ bool cmCPackWIXGenerator::AddComponentsToFeature(
                                       cpackPackageDesktopLinksList);
   }
 
-  AddDirectoryAndFileDefinitons(rootPath, "INSTALL_ROOT", directoryDefinitions,
-                                fileDefinitions, featureDefinitions,
-                                cpackPackageExecutablesList,
-                                cpackPackageDesktopLinksList, shortcuts);
+  AddDirectoryAndFileDefinitions(
+    rootPath, "INSTALL_ROOT", directoryDefinitions, fileDefinitions,
+    featureDefinitions, cpackPackageExecutablesList,
+    cpackPackageDesktopLinksList, shortcuts);
 
   featureDefinitions.EndElement("FeatureRef");
 
@@ -841,7 +841,7 @@ bool cmCPackWIXGenerator::CreateLicenseFile()
   return true;
 }
 
-void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
+void cmCPackWIXGenerator::AddDirectoryAndFileDefinitions(
   std::string const& topdir, std::string const& directoryId,
   cmWIXDirectoriesSourceWriter& directoryDefinitions,
   cmWIXFilesSourceWriter& fileDefinitions,
@@ -907,7 +907,7 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
       directoryDefinitions.AddAttribute("Id", subDirectoryId);
       directoryDefinitions.AddAttribute("Name", fileName);
 
-      AddDirectoryAndFileDefinitons(
+      AddDirectoryAndFileDefinitions(
         fullPath, subDirectoryId, directoryDefinitions, fileDefinitions,
         featureDefinitions, packageExecutables, desktopExecutables, shortcuts);
 
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h
index 353d6c0..b2633a7 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.h
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.h
@@ -104,7 +104,7 @@ private:
 
   bool RunLightCommand(std::string const& objectFiles);
 
-  void AddDirectoryAndFileDefinitons(
+  void AddDirectoryAndFileDefinitions(
     std::string const& topdir, std::string const& directoryId,
     cmWIXDirectoriesSourceWriter& directoryDefinitions,
     cmWIXFilesSourceWriter& fileDefinitions,

-----------------------------------------------------------------------

Summary of changes:
 Help/release/dev/wix-attributes-patch.rst      |    7 +++++++
 Source/CPack/WiX/cmCPackWIXGenerator.cxx       |   14 ++++++-------
 Source/CPack/WiX/cmCPackWIXGenerator.h         |    2 +-
 Source/CPack/WiX/cmWIXFeaturesSourceWriter.cxx |    4 ++--
 Source/CPack/WiX/cmWIXFilesSourceWriter.cxx    |    4 ++--
 Source/CPack/WiX/cmWIXPatch.cxx                |    6 +++++-
 Source/CPack/WiX/cmWIXPatchParser.cxx          |   26 ++++++++++++++++++------
 7 files changed, 44 insertions(+), 19 deletions(-)
 create mode 100644 Help/release/dev/wix-attributes-patch.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list