mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-08 23:00:07 -06:00
Merge branch 'backport-kwsys-SystemTools-copy-self' into release-3.14
Merge-request: !3145
This commit is contained in:
@@ -2307,10 +2307,6 @@ static bool CloneFileContent(const std::string& source,
|
||||
bool SystemTools::CopyFileAlways(const std::string& source,
|
||||
const std::string& destination)
|
||||
{
|
||||
// If files are the same do not copy
|
||||
if (SystemTools::SameFile(source, destination)) {
|
||||
return true;
|
||||
}
|
||||
mode_t perm = 0;
|
||||
bool perms = SystemTools::GetPermissions(source, perm);
|
||||
std::string real_destination = destination;
|
||||
@@ -2331,6 +2327,10 @@ bool SystemTools::CopyFileAlways(const std::string& source,
|
||||
} else {
|
||||
destination_dir = SystemTools::GetFilenamePath(destination);
|
||||
}
|
||||
// If files are the same do not copy
|
||||
if (SystemTools::SameFile(source, real_destination)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Create destination directory
|
||||
|
||||
|
||||
Reference in New Issue
Block a user