mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-21 05:38:24 -05:00
Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream * upstream-KWSys: KWSys 2020-02-17 (3e117fe1)
This commit is contained in:
@@ -536,7 +536,7 @@ IF(KWSYS_USE_SystemInformation)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
INCLUDE(CheckSymbolExists)
|
INCLUDE(CheckSymbolExists)
|
||||||
SET(CMAKE_REQUIRED_LIBRARIES Psapi)
|
SET(CMAKE_REQUIRED_LIBRARIES psapi)
|
||||||
CHECK_SYMBOL_EXISTS(GetProcessMemoryInfo "windows.h;psapi.h" KWSYS_SYS_HAS_PSAPI)
|
CHECK_SYMBOL_EXISTS(GetProcessMemoryInfo "windows.h;psapi.h" KWSYS_SYS_HAS_PSAPI)
|
||||||
UNSET(CMAKE_REQUIRED_LIBRARIES)
|
UNSET(CMAKE_REQUIRED_LIBRARIES)
|
||||||
IF(KWSYS_SYS_HAS_PSAPI)
|
IF(KWSYS_SYS_HAS_PSAPI)
|
||||||
|
|||||||
@@ -2186,12 +2186,15 @@ bool SystemTools::CopyFileIfDifferent(const std::string& source,
|
|||||||
// FilesDiffer does not handle file to directory compare
|
// FilesDiffer does not handle file to directory compare
|
||||||
if (SystemTools::FileIsDirectory(destination)) {
|
if (SystemTools::FileIsDirectory(destination)) {
|
||||||
const std::string new_destination = FileInDir(source, destination);
|
const std::string new_destination = FileInDir(source, destination);
|
||||||
return SystemTools::CopyFileIfDifferent(source, new_destination);
|
if (!SystemTools::ComparePath(new_destination, destination)) {
|
||||||
}
|
return SystemTools::CopyFileIfDifferent(source, new_destination);
|
||||||
// source and destination are files so do a copy if they
|
}
|
||||||
// are different
|
} else {
|
||||||
if (SystemTools::FilesDiffer(source, destination)) {
|
// source and destination are files so do a copy if they
|
||||||
return SystemTools::CopyFileAlways(source, destination);
|
// are different
|
||||||
|
if (SystemTools::FilesDiffer(source, destination)) {
|
||||||
|
return SystemTools::CopyFileAlways(source, destination);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// at this point the files must be the same so return true
|
// at this point the files must be the same so return true
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1074,6 +1074,15 @@ static bool CheckCopyFileIfDifferent()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!kwsys::SystemTools::MakeDirectory("dir_a") ||
|
||||||
|
!kwsys::SystemTools::MakeDirectory("dir_b")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!kwsys::SystemTools::CopyFileIfDifferent("dir_a/", "dir_b")) {
|
||||||
|
ret = false;
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user