mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-27 11:18:35 -06:00
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.
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user