From 0add8c6329853e086682ef1599cb7fab0f576ff9 Mon Sep 17 00:00:00 2001 From: KWSys Upstream Date: Sat, 8 Aug 2026 10:24:19 -0400 Subject: [PATCH 1/2] KWSys 2026-08-08 (19691df6) Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 19691df656b78097f5ad9d810b068fa3df73e023 (master). Upstream Shortlog ----------------- Ben Boeckel (1): 6a287bb5 SystemTools: rename `CopyWhen::{Always => Unconditional}` --- SystemTools.cxx | 6 +++--- SystemTools.hxx.in | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SystemTools.cxx b/SystemTools.cxx index 9633ab130f..0e64be4aa3 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -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); } diff --git a/SystemTools.hxx.in b/SystemTools.hxx.in index 6397714c59..f7480558d7 100644 --- a/SystemTools.hxx.in +++ b/SystemTools.hxx.in @@ -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); From f188f74bbde0457f09c61d9e5ef24da3b4be18e9 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 6 Aug 2026 17:36:49 -0400 Subject: [PATCH 2/2] KWSys: update for `CopyWhen::{Always => Unconditional}` rename KWSys renamed `Always` to `Unconditional` because the former conflicts with a X11 macro. --- Source/cmFileCommand.cxx | 2 +- Source/cmSystemTools.cxx | 2 +- Source/cmcmd.cxx | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index fb82c3cce3..2ebf38c9c5 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -1570,7 +1570,7 @@ bool HandleCopyFile(std::vector 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 diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index f5e98ce09b..5db9545a14 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -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)) { diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 517767acc7..ac245f837c 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1096,7 +1096,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector 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") {