[Cmake-commits] CMake branch, next, updated. v3.4.1-1680-g3c09aff

Nils Gladitz nilsgladitz at gmail.com
Thu Dec 10 10:39:39 EST 2015


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, next has been updated
       via  3c09aff91048787b6d3a019b36a81e1bd3a8562f (commit)
       via  ecdc77f14d7a37f9d173ea2ca4946bf51c6a43d0 (commit)
      from  d94e61ab747b1eb3e8209a8e6011cbd4926122db (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=3c09aff91048787b6d3a019b36a81e1bd3a8562f
commit 3c09aff91048787b6d3a019b36a81e1bd3a8562f
Merge: d94e61a ecdc77f
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Thu Dec 10 10:39:38 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Dec 10 10:39:38 2015 -0500

    Merge topic 'wix-fix-comp-install-prop' into next
    
    ecdc77f1 CPackWIX: Fix installed file property lookups when using components


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ecdc77f14d7a37f9d173ea2ca4946bf51c6a43d0
commit ecdc77f14d7a37f9d173ea2ca4946bf51c6a43d0
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Thu Dec 10 17:38:18 2015 +0100
Commit:     Nils Gladitz <nilsgladitz at gmail.com>
CommitDate: Thu Dec 10 17:38:18 2015 +0100

    CPackWIX: Fix installed file property lookups when using components
    
    The WIX generator incorrectly looked for installed file properties
    by relative paths that included the component specific staging
    directory prefix.
    
    Remove that prefix in installed file property lookups when
    generating packages with components.

diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index d5246db..da8b486 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -911,8 +911,9 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
     relativeDirectoryPath = ".";
     }
 
-  cmInstalledFile const* directoryInstalledFile =
-    this->GetInstalledFile(relativeDirectoryPath);
+  cmInstalledFile const* directoryInstalledFile = this->GetInstalledFile(
+      this->RelativePathWithoutComponentPrefix(relativeDirectoryPath)
+  );
 
   bool emptyDirectory = dir.GetNumberOfFiles() == 2;
   bool createDirectory = false;
@@ -980,8 +981,9 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons(
       }
     else
       {
-      cmInstalledFile const* installedFile =
-        this->GetInstalledFile(relativePath);
+      cmInstalledFile const* installedFile = this->GetInstalledFile(
+        this->RelativePathWithoutComponentPrefix(relativePath)
+      );
 
       if(installedFile)
         {
@@ -1230,3 +1232,16 @@ void cmCPackWIXGenerator::AddCustomFlags(
       stream << " " << QuotePath(*i);
     }
 }
+
+std::string cmCPackWIXGenerator::RelativePathWithoutComponentPrefix(
+  std::string const& path)
+{
+  if(this->Components.empty())
+    {
+    return path;
+    }
+
+  std::string::size_type pos = path.find('/');
+
+  return path.substr(pos + 1);
+}
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h
index d501609..3f66b2c 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.h
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.h
@@ -168,6 +168,9 @@ private:
   void AddCustomFlags(
     std::string const& variableName, std::ostream& stream);
 
+  std::string RelativePathWithoutComponentPrefix(
+    std::string const& path);
+
   std::vector<std::string> WixSources;
   id_map_t PathToIdMap;
   ambiguity_map_t IdAmbiguityCounter;

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

Summary of changes:
 Source/CPack/WiX/cmCPackWIXGenerator.cxx |   23 +++++++++++++++++++----
 Source/CPack/WiX/cmCPackWIXGenerator.h   |    3 +++
 2 files changed, 22 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list