summaryrefslogtreecommitdiffstats
path: root/Source/cmConfigureFileCommand.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-01-26 20:50:38 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-01-26 20:50:38 (GMT)
commit09421a261c188763d3acfc7155d49c1c6fabc3ae (patch)
tree6a84cb27ae5956d4996016fc05efcae76d920a31 /Source/cmConfigureFileCommand.cxx
parent900ad59867f7949b1b3a46ed53adc2d0197b8bb7 (diff)
downloadCMake-09421a261c188763d3acfc7155d49c1c6fabc3ae.zip
CMake-09421a261c188763d3acfc7155d49c1c6fabc3ae.tar.gz
CMake-09421a261c188763d3acfc7155d49c1c6fabc3ae.tar.bz2
ENH: Preserve permissions when copying files
Diffstat (limited to 'Source/cmConfigureFileCommand.cxx')
-rw-r--r--Source/cmConfigureFileCommand.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx
index d2a6443..3bf97c8 100644
--- a/Source/cmConfigureFileCommand.cxx
+++ b/Source/cmConfigureFileCommand.cxx
@@ -74,6 +74,8 @@ void cmConfigureFileCommand::ConfigureFile()
{
m_Makefile->AddCMakeDependFile(m_InputFile.c_str());
cmSystemTools::ConvertToUnixSlashes(m_OuputFile);
+ mode_t perm = 0;
+ cmSystemTools::GetPermissions(m_InputFile.c_str(), perm);
std::string::size_type pos = m_OuputFile.rfind('/');
if(pos != std::string::npos)
{
@@ -142,6 +144,7 @@ void cmConfigureFileCommand::ConfigureFile()
cmSystemTools::CopyFileIfDifferent(tempOutputFile.c_str(),
m_OuputFile.c_str());
cmSystemTools::RemoveFile(tempOutputFile.c_str());
+ cmSystemTools::SetPermissions(m_OuputFile.c_str(), perm);
}
}