diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2015-03-06 13:19:30 (GMT) |
---|---|---|
committer | Nils Gladitz <nilsgladitz@gmail.com> | 2015-03-06 20:09:19 (GMT) |
commit | 2e16aff1e2218f042f403971403fe583fc5bec97 (patch) | |
tree | c984b3227bf3e0b830c84db2be5cd41eb44b853c /Source | |
parent | b0852ebc09eec44041e8aa624ec4bb17bda14dac (diff) | |
download | CMake-2e16aff1e2218f042f403971403fe583fc5bec97.zip CMake-2e16aff1e2218f042f403971403fe583fc5bec97.tar.gz CMake-2e16aff1e2218f042f403971403fe583fc5bec97.tar.bz2 |
CPackWIX: Fix .wixobj output locations and filenames.
Preserve all but the last extension when generating .wixobj output
filenames from source files and make sure they are unique.
Output .wixobj files in cpack staging area instead
of the current working directory.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 19 |
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)) { |