summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-03-04 13:23:42 (GMT)
committerBrad King <brad.king@kitware.com>2021-03-04 13:47:31 (GMT)
commit3600c6cd8c09e501faa06be5f98465e994d51569 (patch)
tree1b67331f5bc6dfa2893e94b97b1fa0ae08469dd0 /Source/cmFileCommand.cxx
parentc61292726cd3018ec502f8d59e62352c8dce62d3 (diff)
downloadCMake-3600c6cd8c09e501faa06be5f98465e994d51569.zip
CMake-3600c6cd8c09e501faa06be5f98465e994d51569.tar.gz
CMake-3600c6cd8c09e501faa06be5f98465e994d51569.tar.bz2
cmSystemTools: Add RenameFile option to not replace destination
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 6243bb2..ab954f2 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -1348,12 +1348,14 @@ bool HandleRename(std::vector<std::string> const& args,
}
std::string err;
- switch (cmSystemTools::RenameFile(oldname, newname, &err)) {
+ switch (cmSystemTools::RenameFile(oldname, newname,
+ cmSystemTools::Replace::Yes, &err)) {
case cmSystemTools::RenameResult::Success:
if (!arguments.Result.empty()) {
status.GetMakefile().AddDefinition(arguments.Result, "0");
}
return true;
+ case cmSystemTools::RenameResult::NoReplace:
case cmSystemTools::RenameResult::Failure:
if (!arguments.Result.empty()) {
status.GetMakefile().AddDefinition(arguments.Result, err);