cmake --install . --component ? : how get the list of valid component to install?

cmdoption-cmake-install-component does not help to get list of possible components to install

bash-5.3$ cmake --install . --component
CMake Error: Invalid value used with --component
Usage: cmake --install <dir> [options]
Options:
  <dir>              = Project binary directory to install.
  --config <cfg>     = For multi-configuration tools, choose <cfg>.
  --component <comp> = Component-based install. Only install <comp>.
  --default-directory-permissions <permission> 
     Default install permission. Use default permission <permission>.
  -j <jobs> --parallel <jobs>
     Build in parallel using the given number of jobs. 
     The CMAKE_INSTALL_PARALLEL_LEVEL environment variable
     specifies a default parallel level when this option is not given.
  --prefix <prefix>  = The installation prefix CMAKE_INSTALL_PREFIX.
  --strip            = Performing install/strip.
  -v --verbose       = Enable verbose output.

bash-5.3$ cmake --install . --component .
-- Install configuration: "Release"
bash-5.3$

I would help to get all possible component names to install instead of this output.

see too How do I list components available with `cmake --install . --component ...`?

what is this target list_install_components for?

bash-5.3$ ninja list_install_components 
ninja: no work to do.
bash-5.3$ ninja -t clean list_install_components 
Cleaning... 0 files.
bash-5.3$ ninja list_install_components -v
ninja: no work to do.
bash-5.3$ 

bash-5.3$ ninja list_install_components 
[0/2] Re-checking globbed directories...
ninja: no work to do.
bash-5.3$ ninja -t targets | grep list_install_components
list_install_components: phony
boostorg/assert/list_install_components: phony
boostorg/core/list_install_components: phony
boostorg/config/list_install_components: phony
boostorg/container_hash/list_install_components: phony
boostorg/describe/list_install_components: phony
boostorg/detail/list_install_components: phony
boostorg/integer/list_install_components: phony
boostorg/mp11/list_install_components: phony
boostorg/preprocessor/list_install_components: phony
boostorg/throw_exception/list_install_components: phony
boostorg/type_index/list_install_components: phony
boostorg/type_traits/list_install_components: phony
boostorg/any/list_install_components: phony
bash-5.3$ grep -o '"boost_[^"]*"' cmake_install.cmake | sort -u
"boost_Development"
bash-5.3$ 

@ben.boeckel something goes wrong, this target does not work?

iMac:cmake clausklein$ git diff
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index c5cd116cfa..d3dda949da 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -3186,7 +3186,9 @@ void cmGlobalGenerator::AddGlobalTarget_Install(
       GlobalTargetInfo gti;
       gti.Name = "list_install_components";
       gti.Message = ostr.str();
-      gti.UsesTerminal = false;
+      gti.UsesTerminal = true;
+      gti.StdPipesUTF8 = true;
+      gti.Role = "install";
       targets.push_back(std::move(gti));
     }
     std::string cmd = cmSystemTools::GetCMakeCommand();
iMac:cmake clausklein$ 

No idea. Seems to be ancient. @brad.king?

It works with Unix Makefiles generator:

bash-5.3$ make list_install_components 
Available install components are: "beman.exemplar" "beman.inplace_vector"
bash-5.3$ 
iMac:Source clausklein$ grep -rw AddInstallComponent .
./cmInstallProgramsCommand.cxx:  mf.GetGlobalGenerator()->AddInstallComponent(
./cmInstallFilesCommand.cxx:  mf.GetGlobalGenerator()->AddInstallComponent(
Binary file ./.cmGlobalGenerator.cxx.swp matches
./cmGlobalGenerator.cxx~:void cmGlobalGenerator::AddInstallComponent(std::string const& component)
./cmGlobalGenerator.h:  void AddInstallComponent(std::string const& component);
./cmInstallTargetsCommand.cxx:  mf.GetGlobalGenerator()->AddInstallComponent(
./cmGlobalGenerator.cxx:void cmGlobalGenerator::AddInstallComponent(std::string const& component)
./cmInstallCommand.cxx:  helper.Makefile->GetGlobalGenerator()->AddInstallComponent(component);
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:      helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:  helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:  helper.Makefile->GetGlobalGenerator()->AddInstallComponent(component);
./cmInstallCommand.cxx:  helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:  helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:  helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:    helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
./cmInstallCommand.cxx:  helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
iMac:Source clausklein$ 

It looks like make list_install_components was added by CMake commit 7ded253013b6 in 2006 but was never documented.