[Cmake-commits] CMake branch, next, updated. v2.8.12.1-5114-gba5fe34
Brad King
brad.king at kitware.com
Wed Nov 13 09:49:25 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 ba5fe34a3461f25d29643caea1ae76c2298c4573 (commit)
via 096591b96a0fb8cac2b330bc727c96ff90fa8d97 (commit)
from 1a3f1f2c42f2d9880a86ea00c9060ef8fda81dda (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=ba5fe34a3461f25d29643caea1ae76c2298c4573
commit ba5fe34a3461f25d29643caea1ae76c2298c4573
Merge: 1a3f1f2 096591b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Nov 13 09:49:07 2013 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Nov 13 09:49:07 2013 -0500
Merge topic 'wix-custom-arguments' into next
096591b CPackWiX: Add variables for custom tool extensions and flags
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=096591b96a0fb8cac2b330bc727c96ff90fa8d97
commit 096591b96a0fb8cac2b330bc727c96ff90fa8d97
Author: Nils Gladitz <nilsgladitz at gmail.com>
AuthorDate: Sun Nov 10 19:48:29 2013 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 12 14:10:01 2013 -0500
CPackWiX: Add variables for custom tool extensions and flags
diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake
index f4fcf6a..3f0978d 100644
--- a/Modules/CPackWIX.cmake
+++ b/Modules/CPackWIX.cmake
@@ -123,9 +123,31 @@
# 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.
+#
#=============================================================================
-# Copyright 2012 Kitware, Inc.
+# Copyright 2013 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
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:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list