cmGeneratedFileStream: Use absolute paths

Use absolute paths in cmGeneratedFileStream to ensure output can be found
if the working directory changes.

Fixes: #23784
This commit is contained in:
Martin Duffy
2022-07-29 17:43:11 -04:00
parent 514804c8bc
commit b02ef99fea

View File

@@ -124,10 +124,10 @@ cmGeneratedFileStreamBase::~cmGeneratedFileStreamBase()
void cmGeneratedFileStreamBase::Open(std::string const& name)
{
// Save the original name of the file.
this->Name = name;
this->Name = cmSystemTools::CollapseFullPath(name);
// Create the name of the temporary file.
this->TempName = name;
this->TempName = this->Name;
#if defined(__VMS)
this->TempName += "_";
#else
@@ -231,7 +231,7 @@ int cmGeneratedFileStreamBase::RenameFile(std::string const& oldname,
void cmGeneratedFileStream::SetName(const std::string& fname)
{
this->Name = fname;
this->Name = cmSystemTools::CollapseFullPath(fname);
}
void cmGeneratedFileStream::SetTempExt(std::string const& ext)