From 2673161b6750b239ca3d0f1d40402b9f4f37c1b1 Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Fri, 11 Sep 2026 12:22:25 -0400 Subject: [PATCH] install: Improve documentation, argument parsing Adjust documentation of `install(CODE|SCRIPT)` to more understandably reflect how the subcommand actually operates. Adjust argument parsing of the same to "accept" the `COMPONENT` argument being given more than once, consistent with how single-valued arguments are usually parsed. --- Help/command/install.rst | 2 +- Source/cmInstallCommand.cxx | 25 +++++-------------- .../install/SCRIPT-CODE-arguments-stderr.txt | 8 ------ 3 files changed, 7 insertions(+), 28 deletions(-) diff --git a/Help/command/install.rst b/Help/command/install.rst index cc2b9ecc20..13b062524b 100644 --- a/Help/command/install.rst +++ b/Help/command/install.rst @@ -841,7 +841,7 @@ Signatures .. code-block:: cmake - install([[SCRIPT ] [CODE ]] + install({ SCRIPT | CODE }... [ALL_COMPONENTS | COMPONENT ] [EXCLUDE_FROM_ALL]) diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 89167ab544..38d514a7c3 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -923,14 +923,8 @@ bool HandleScriptMode(std::vector const& args, return ArgumentParser::Continue::No; } - ArgumentParser::Continue AddComponent(cm::string_view value) - { - this->Components.emplace_back(value); - return ArgumentParser::Continue::No; - } - std::vector