mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-08 16:50:48 +00:00
Merge topic 'update-kwsys'
f188f74bbdKWSys: update for `CopyWhen::{Always => Unconditional}` rename4684e97400Merge branch 'upstream-KWSys' into update-kwsys0add8c6329KWSys 2026-08-08 (19691df6) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !12383
This commit is contained in:
@@ -1570,7 +1570,7 @@ bool HandleCopyFile(std::vector<std::string> const& args,
|
||||
if (arguments.OnlyIfDifferent) {
|
||||
when = cmSystemTools::CopyWhen::OnlyIfDifferent;
|
||||
} else {
|
||||
when = cmSystemTools::CopyWhen::Always;
|
||||
when = cmSystemTools::CopyWhen::Unconditional;
|
||||
}
|
||||
cmSystemTools::CopyInputRecent const inputRecent = arguments.InputMayBeRecent
|
||||
? cmSystemTools::CopyInputRecent::Yes
|
||||
|
||||
@@ -1556,7 +1556,7 @@ cmSystemTools::CopyResult cmSystemTools::CopySingleFile(
|
||||
CopyInputRecent inputRecent, std::string* err)
|
||||
{
|
||||
switch (when) {
|
||||
case CopyWhen::Always:
|
||||
case CopyWhen::Unconditional:
|
||||
break;
|
||||
case CopyWhen::OnlyIfDifferent:
|
||||
if (!FilesDiffer(oldname, newname)) {
|
||||
|
||||
@@ -1096,7 +1096,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
|
||||
if (args[1] == "copy_directory" ||
|
||||
args[1] == "copy_directory_if_different" ||
|
||||
args[1] == "copy_directory_if_newer") {
|
||||
cmsys::SystemTools::CopyWhen when = cmsys::SystemTools::CopyWhen::Always;
|
||||
cmsys::SystemTools::CopyWhen when =
|
||||
cmsys::SystemTools::CopyWhen::Unconditional;
|
||||
if (args[1] == "copy_directory_if_different") {
|
||||
when = cmsys::SystemTools::CopyWhen::OnlyIfDifferent;
|
||||
} else if (args[1] == "copy_directory_if_newer") {
|
||||
|
||||
@@ -2599,7 +2599,7 @@ SystemTools::CopyStatus SystemTools::CopyAFile(std::string const& source,
|
||||
SystemTools::CopyWhen when)
|
||||
{
|
||||
switch (when) {
|
||||
case SystemTools::CopyWhen::Always:
|
||||
case SystemTools::CopyWhen::Unconditional:
|
||||
return SystemTools::CopyFileAlways(source, destination);
|
||||
case SystemTools::CopyWhen::OnlyIfDifferent:
|
||||
return SystemTools::CopyFileIfDifferent(source, destination);
|
||||
@@ -2617,7 +2617,7 @@ SystemTools::CopyStatus SystemTools::CopyAFile(std::string const& source,
|
||||
bool always)
|
||||
{
|
||||
return SystemTools::CopyAFile(source, destination,
|
||||
always ? CopyWhen::Always
|
||||
always ? CopyWhen::Unconditional
|
||||
: CopyWhen::OnlyIfDifferent);
|
||||
}
|
||||
|
||||
@@ -2670,7 +2670,7 @@ Status SystemTools::CopyADirectory(std::string const& source,
|
||||
std::string const& destination, bool always)
|
||||
{
|
||||
return SystemTools::CopyADirectory(source, destination,
|
||||
always ? CopyWhen::Always
|
||||
always ? CopyWhen::Unconditional
|
||||
: CopyWhen::OnlyIfDifferent);
|
||||
}
|
||||
|
||||
|
||||
@@ -665,7 +665,7 @@ public:
|
||||
|
||||
enum class CopyWhen
|
||||
{
|
||||
Always,
|
||||
Unconditional,
|
||||
OnlyIfDifferent,
|
||||
OnlyIfNewer,
|
||||
};
|
||||
@@ -675,20 +675,20 @@ public:
|
||||
*/
|
||||
static CopyStatus CopyAFile(std::string const& source,
|
||||
std::string const& destination,
|
||||
CopyWhen when = CopyWhen::Always);
|
||||
CopyWhen when = CopyWhen::Unconditional);
|
||||
static CopyStatus CopyAFile(std::string const& source,
|
||||
std::string const& destination, bool always);
|
||||
|
||||
/**
|
||||
* Copy content directory to another directory with all files and
|
||||
* subdirectories. The "when" argument controls when files are copied:
|
||||
* Always: all files are always copied.
|
||||
* Unconditional: all files are always copied.
|
||||
* OnlyIfDifferent: only files that have changed are copied.
|
||||
* OnlyIfNewer: only files that are newer than the destination are copied.
|
||||
*/
|
||||
static Status CopyADirectory(std::string const& source,
|
||||
std::string const& destination,
|
||||
CopyWhen when = CopyWhen::Always);
|
||||
CopyWhen when = CopyWhen::Unconditional);
|
||||
static Status CopyADirectory(std::string const& source,
|
||||
std::string const& destination, bool always);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user