summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratedFileStream.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-05-10 15:11:28 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-05-10 15:11:28 (GMT)
commitefcb43a88fc6f9dafbfdb8d98ed899edbf7ad8c6 (patch)
treef154a9a1e61fa99dd0890aa4e3fea850298709da /Source/cmGeneratedFileStream.cxx
parentdd9e2b904c33787c193bc07d7f811552dfaa72b2 (diff)
downloadCMake-efcb43a88fc6f9dafbfdb8d98ed899edbf7ad8c6.zip
CMake-efcb43a88fc6f9dafbfdb8d98ed899edbf7ad8c6.tar.gz
CMake-efcb43a88fc6f9dafbfdb8d98ed899edbf7ad8c6.tar.bz2
ENH: Allow changing of file name
Diffstat (limited to 'Source/cmGeneratedFileStream.cxx')
-rw-r--r--Source/cmGeneratedFileStream.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx
index d70bc5c..d0f2cc0 100644
--- a/Source/cmGeneratedFileStream.cxx
+++ b/Source/cmGeneratedFileStream.cxx
@@ -162,7 +162,8 @@ void cmGeneratedFileStreamBase::Close()
// Only consider replacing the destination file if no error
// occurred.
- if(m_Okay &&
+ if(!m_Name.empty() &&
+ m_Okay &&
(!m_CopyIfDifferent ||
cmSystemTools::FilesDiffer(m_TempName.c_str(), resname.c_str())))
{
@@ -277,3 +278,14 @@ int cmGeneratedFileStreamBase::RenameFile(const char* oldname,
return rename(oldname, newname) == 0;
#endif
}
+
+//----------------------------------------------------------------------------
+void cmGeneratedFileStream::SetName(const char* fname)
+{
+ if ( !fname )
+ {
+ m_Name = "";
+ return;
+ }
+ m_Name = fname;
+}