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
This commit is contained in:
Craig Scott
2024-12-11 20:21:14 +11:00
committed by Brad King
parent 793c5f11f6
commit 92e63421cb

View File

@@ -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("$<PATH:CMAKE_PATH,NORMALIZE,", arg, '>');
}
return ArgumentParser::Continue::Yes;
return ArgumentParser::Continue::No;
};
break;
case cmPolicies::REQUIRED_ALWAYS: