From 92e63421cbd423bb5ffcb849fe3a347a6cb07e39 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Wed, 11 Dec 2024 20:21:14 +1100 Subject: [PATCH] install: Restore treatment of DESTINATION as a single-valued keyword The `install(RUNTIME_DEPENDENCY_SET)` form processes its arguments in a slightly different way to other forms of the command. It handles the `POST_...`, `PRE_...` and `DIRECTORIES` keywords separately. These keywords are not visible to the first layer of keyword processing, so they don't terminate multi-value keyword value parsing. Before commit 6a1fac1450 (install: Normalize DESTINATION paths, 2024-09-18, v3.31.0-rc1~73^2), the `DESTINATION` keyword was handled as a simple string value. That commit changed it to use a function so it could process the value before storing it, but the function returned the wrong value. This meant it was treated as a multi-value keyword instead of a single-value keyword. Fixes: #26512 --- Source/cmInstallCommandArguments.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx index f371cff208..8e12cfe56f 100644 --- a/Source/cmInstallCommandArguments.cxx +++ b/Source/cmInstallCommandArguments.cxx @@ -37,7 +37,7 @@ cmInstallCommandArguments::cmInstallCommandArguments( case cmPolicies::OLD: normalizeDest = [this](cm::string_view arg) -> ArgumentParser::Continue { this->Destination = std::string(arg.begin(), arg.end()); - return ArgumentParser::Continue::Yes; + return ArgumentParser::Continue::No; }; break; case cmPolicies::WARN: @@ -52,7 +52,7 @@ cmInstallCommandArguments::cmInstallCommandArguments( MessageType::AUTHOR_WARNING, cmPolicies::GetPolicyWarning(cmPolicies::CMP0177)); } - return ArgumentParser::Continue::Yes; + return ArgumentParser::Continue::No; }; break; case cmPolicies::NEW: @@ -63,7 +63,7 @@ cmInstallCommandArguments::cmInstallCommandArguments( this->Destination = cmStrCat("$'); } - return ArgumentParser::Continue::Yes; + return ArgumentParser::Continue::No; }; break; case cmPolicies::REQUIRED_ALWAYS: