summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-02-17 16:59:07 (GMT)
committerBrad King <brad.king@kitware.com>2020-02-17 16:59:07 (GMT)
commitfc6eced05e289d7cf62c95efe8e4f31cb71908d4 (patch)
tree974ee48f77f0df8614fab42385a0fb9f7e7b5f3e /Source/kwsys/SystemTools.cxx
parent451360c72914d28cc10ba36d2215aed756e568e5 (diff)
parent96dd383ceb6568ca4e02c71b271cca394ade6e55 (diff)
downloadCMake-fc6eced05e289d7cf62c95efe8e4f31cb71908d4.zip
CMake-fc6eced05e289d7cf62c95efe8e4f31cb71908d4.tar.gz
CMake-fc6eced05e289d7cf62c95efe8e4f31cb71908d4.tar.bz2
Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream * upstream-KWSys: KWSys 2020-02-17 (3e117fe1)
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r--Source/kwsys/SystemTools.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 39873e6..d27081b 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -2186,12 +2186,15 @@ bool SystemTools::CopyFileIfDifferent(const std::string& source,
// FilesDiffer does not handle file to directory compare
if (SystemTools::FileIsDirectory(destination)) {
const std::string new_destination = FileInDir(source, destination);
- return SystemTools::CopyFileIfDifferent(source, new_destination);
- }
- // source and destination are files so do a copy if they
- // are different
- if (SystemTools::FilesDiffer(source, destination)) {
- return SystemTools::CopyFileAlways(source, destination);
+ if (!SystemTools::ComparePath(new_destination, destination)) {
+ return SystemTools::CopyFileIfDifferent(source, new_destination);
+ }
+ } else {
+ // source and destination are files so do a copy if they
+ // are different
+ if (SystemTools::FilesDiffer(source, destination)) {
+ return SystemTools::CopyFileAlways(source, destination);
+ }
}
// at this point the files must be the same so return true
return true;