[Cmake-commits] CMake branch, next, updated. v2.8.12.1-5042-g9531f25

Nils Gladitz nilsgladitz at gmail.com
Sun Nov 10 13:48:52 EST 2013


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  9531f2587cb6782ba1d17214c14be1cad38d050c (commit)
       via  11c02ddd0f61c211b00cbbb6b3ea64e24773095b (commit)
      from  6fb1bc23ee4946ac81151ce64786b51eabd1f04e (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9531f2587cb6782ba1d17214c14be1cad38d050c
commit 9531f2587cb6782ba1d17214c14be1cad38d050c
Merge: 6fb1bc2 11c02dd
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Sun Nov 10 13:48:50 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Nov 10 13:48:50 2013 -0500

    Merge topic 'wix-custom-arguments' into next
    
    11c02dd CPackWiX: added variables for custom tool extensions and flags


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=11c02ddd0f61c211b00cbbb6b3ea64e24773095b
commit 11c02ddd0f61c211b00cbbb6b3ea64e24773095b
Author:     Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Sun Nov 10 19:48:29 2013 +0100
Commit:     Nils Gladitz <nilsgladitz at gmail.com>
CommitDate: Sun Nov 10 19:48:29 2013 +0100

    CPackWiX: added variables for custom tool extensions and flags

diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake
index f4fcf6a..aceba4a 100644
--- a/Modules/CPackWIX.cmake
+++ b/Modules/CPackWIX.cmake
@@ -123,6 +123,32 @@
 #  This variable provides an optional list of extra WiX object (.wixobj)
 #  and/or WiX library (.wixlib) files.  The full path to objects and libraries
 #  is required.
+#
+# .. variable:: CPACK_WIX_EXTENSIONS
+#
+#  This variable provides a list of additional extensions for the WiX
+#  tools light and candle.
+#
+# .. variable:: CPACK_WIX_<TOOL>_EXTENSIONS
+#
+#  This is the tool specific version of CPACK_WIX_EXTENSIONS.
+#  <TOOL> can be either LIGHT or CANDLE.
+#
+# .. variable:: CPACK_WIX_<TOOL>_EXTRA_FLAGS
+#
+#  This list variable allows you to pass additional
+#  flags to the WiX tool <TOOL>.
+#
+#  Use it at your own risk.
+#  Future versions of CPack may generate flags which may be in conflict
+#  with your own flags.
+#
+#  <TOOL> can be either LIGHT or CANDLE.
+#
+
+#  Future versions of CMake may
+#
+#
 
 #=============================================================================
 # Copyright 2012 Kitware, Inc.
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 448d8d1..1d7681b 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -83,6 +83,15 @@ bool cmCPackWIXGenerator::RunCandleCommand(
   command << " -nologo";
   command << " -arch " << GetArchitecture();
   command << " -out " << QuotePath(objectFile);
+
+  for(extension_set_t::const_iterator i = candleExtensions.begin();
+      i != candleExtensions.end(); ++i)
+    {
+    command << " -ext " << QuotePath(*i);
+    }
+
+  AddCustomFlags("CPACK_WIX_CANDLE_EXTRA_FLAGS", command);
+
   command << " " << QuotePath(sourceFile);
 
   return RunWiXCommand(command.str());
@@ -100,12 +109,21 @@ bool cmCPackWIXGenerator::RunLightCommand(const std::string& objectFiles)
   command << QuotePath(executable);
   command << " -nologo";
   command << " -out " << QuotePath(packageFileNames.at(0));
-  command << " -ext WixUIExtension";
+
+  for(extension_set_t::const_iterator i = lightExtensions.begin();
+      i != lightExtensions.end(); ++i)
+    {
+    command << " -ext " << QuotePath(*i);
+    }
+
   const char* const cultures = GetOption("CPACK_WIX_CULTURES");
   if(cultures)
     {
     command << " -cultures:" << cultures;
     }
+
+  AddCustomFlags("CPACK_WIX_LIGHT_EXTRA_FLAGS", command);
+
   command << " " << objectFiles;
 
   return RunWiXCommand(command.str());
@@ -172,14 +190,21 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
 
   if(GetOption("CPACK_PACKAGE_VENDOR") == 0)
     {
-      std::string defaultVendor = "Humanity";
-      SetOption("CPACK_PACKAGE_VENDOR", defaultVendor.c_str());
+    std::string defaultVendor = "Humanity";
+    SetOption("CPACK_PACKAGE_VENDOR", defaultVendor.c_str());
 
-      cmCPackLogger(cmCPackLog::LOG_VERBOSE,
-        "CPACK_PACKAGE_VENDOR implicitly set to " << defaultVendor << " . "
-        << std::endl);
+    cmCPackLogger(cmCPackLog::LOG_VERBOSE,
+      "CPACK_PACKAGE_VENDOR implicitly set to " << defaultVendor << " . "
+      << std::endl);
     }
 
+  CollectExtensions("CPACK_WIX_EXTENSIONS", candleExtensions);
+  CollectExtensions("CPACK_WIX_CANDLE_EXTENSIONS", candleExtensions);
+
+  lightExtensions.insert("WixUIExtension");
+  CollectExtensions("CPACK_WIX_EXTENSIONS", lightExtensions);
+  CollectExtensions("CPACK_WIX_LIGHT_EXTENSIONS", lightExtensions);
+
   return true;
 }
 
@@ -865,3 +890,35 @@ bool cmCPackWIXGenerator::IsLegalIdCharacter(char c)
       (c >= 'A' && c <= 'Z') ||
       c == '_' || c == '.';
 }
+
+void cmCPackWIXGenerator::CollectExtensions(
+     const std::string& variableName, extension_set_t& extensions)
+{
+  const char *variableContent = GetOption(variableName.c_str());
+  if(!variableContent) return;
+
+  std::vector<std::string> list;
+  cmSystemTools::ExpandListArgument(variableContent, list);
+
+  for(std::vector<std::string>::const_iterator i = list.begin();
+    i != list.end(); ++i)
+    {
+    extensions.insert(*i);
+    }
+}
+
+void cmCPackWIXGenerator::AddCustomFlags(
+  const std::string& variableName, std::ostream& stream)
+{
+  const char *variableContent = GetOption(variableName.c_str());
+  if(!variableContent) return;
+
+  std::vector<std::string> list;
+  cmSystemTools::ExpandListArgument(variableContent, list);
+
+  for(std::vector<std::string>::const_iterator i = list.begin();
+    i != list.end(); ++i)
+    {
+      stream << " " << QuotePath(*i);
+    }
+}
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h
index c96ad5a..481a07d 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.h
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.h
@@ -63,6 +63,7 @@ private:
   typedef std::map<std::string, std::string> id_map_t;
   typedef std::map<std::string, size_t> ambiguity_map_t;
   typedef std::map<std::string, cmWIXShortcut> shortcut_map_t;
+  typedef std::set<std::string> extension_set_t;
 
   bool InitializeWiXConfiguration();
 
@@ -129,10 +130,19 @@ private:
 
   static bool IsLegalIdCharacter(char c);
 
+  void CollectExtensions(
+       const std::string& variableName, extension_set_t& extensions);
+
+  void AddCustomFlags(
+    const std::string& variableName, std::ostream& stream);
+
   std::vector<std::string> wixSources;
   id_map_t pathToIdMap;
   ambiguity_map_t idAmbiguityCounter;
   shortcut_map_t shortcutMap;
+
+  extension_set_t candleExtensions;
+  extension_set_t lightExtensions;
 };
 
 #endif

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

Summary of changes:
 Modules/CPackWIX.cmake                   |   26 +++++++++++
 Source/CPack/WiX/cmCPackWIXGenerator.cxx |   69 +++++++++++++++++++++++++++---
 Source/CPack/WiX/cmCPackWIXGenerator.h   |   10 ++++
 3 files changed, 99 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list