summaryrefslogtreecommitdiffstats
path: root/Source/CPack/WiX/cmCPackWIXGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CPack/WiX/cmCPackWIXGenerator.cxx')
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 13edde3..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))
{