diff options
author | Brad King <brad.king@kitware.com> | 2019-03-27 18:22:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-03-27 18:22:52 (GMT) |
commit | 52bb1760ff654e2bfaec708ccf143fd1b0f8cd37 (patch) | |
tree | a4c36aab905b1448e47c2a42fc01049cffcf3202 | |
parent | 97c163f5f7bd9c056b6ca0dd03f1b239ff61764b (diff) | |
parent | ce180cf810841ccc813ba7becc8043dd426fc966 (diff) | |
download | CMake-52bb1760ff654e2bfaec708ccf143fd1b0f8cd37.zip CMake-52bb1760ff654e2bfaec708ccf143fd1b0f8cd37.tar.gz CMake-52bb1760ff654e2bfaec708ccf143fd1b0f8cd37.tar.bz2 |
Merge branch 'backport-kwsys-SystemTools-copy-self' into release-3.14
Merge-request: !3145
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index cbdfe11..d8904fe 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -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 |