summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-03-09 13:45:57 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-03-09 13:45:57 (GMT)
commit6f28bc6b511ff8052968c2a7d40a3dc5bcfcb2aa (patch)
treeeb3141d4ff7c6af3173bfd21c5723c28d27dd10e
parent3f66bde4f70566166437dc4d7c9beaeba1ee33ee (diff)
parent2e16aff1e2218f042f403971403fe583fc5bec97 (diff)
downloadCMake-6f28bc6b511ff8052968c2a7d40a3dc5bcfcb2aa.zip
CMake-6f28bc6b511ff8052968c2a7d40a3dc5bcfcb2aa.tar.gz
CMake-6f28bc6b511ff8052968c2a7d40a3dc5bcfcb2aa.tar.bz2
Merge topic 'fix-wixobj-filenames'
2e16aff1 CPackWIX: Fix .wixobj output locations and filenames. b0852ebc CPackWIX: Support patching of root <Feature> elements.
-rw-r--r--Modules/CPackWIX.cmake6
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx20
2 files changed, 23 insertions, 3 deletions
diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake
index 105df96..5fe51a6 100644
--- a/Modules/CPackWIX.cmake
+++ b/Modules/CPackWIX.cmake
@@ -148,8 +148,10 @@
# Currently fragments can be injected into most
# Component, File and Directory elements.
#
-# The special Id ``#PRODUCT`` can be used to inject content
-# into the ``<Product>`` element.
+# The following additional special Ids can be used:
+#
+# * ``#PRODUCT`` for the ``<Product>`` element.
+# * ``#PRODUCTFEATURE`` for the root ``<Feature>`` element.
#
# The following example illustrates how this works.
#
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 4b8daf8..257ce7a 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -265,13 +265,30 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
AppendUserSuppliedExtraSources();
+ std::set<std::string> usedBaseNames;
+
std::stringstream objectFiles;
for(size_t i = 0; i < this->WixSources.size(); ++i)
{
std::string const& sourceFilename = this->WixSources[i];
+ std::string baseName =
+ cmSystemTools::GetFilenameWithoutLastExtension(sourceFilename);
+
+ unsigned int counter = 0;
+ std::string uniqueBaseName = baseName;
+
+ while(usedBaseNames.find(uniqueBaseName) != usedBaseNames.end())
+ {
+ std::stringstream tmp;
+ tmp << baseName << ++counter;
+ uniqueBaseName = tmp.str();
+ }
+
+ usedBaseNames.insert(uniqueBaseName);
+
std::string objectFilename =
- cmSystemTools::GetFilenameWithoutExtension(sourceFilename) + ".wixobj";
+ this->CPackTopLevel + "/" + uniqueBaseName + ".wixobj";
if(!RunCandleCommand(sourceFilename, objectFilename))
{
@@ -474,6 +491,7 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles()
featureDefinitions.AddAttribute("Title", cpackPackageName);
featureDefinitions.AddAttribute("Level", "1");
+ this->Patch->ApplyFragment("#PRODUCTFEATURE", featureDefinitions);
const char* package = GetOption("CPACK_WIX_CMAKE_PACKAGE_REGISTRY");
if(package)