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

**URL:** https://discourse.cmake.org/t/cmake-install-component-how-get-the-list-of-valid-component-to-install/15510
**Category:** Development
**Tags:** gen:ninja
**Created:** [February 14, 2026, 7:37pm UTC](https://discourse.cmake.org/t/cmake-install-component-how-get-the-list-of-valid-component-to-install/15510 "2026-02-14T19:37:28Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [February 14, 2026, 7:37pm UTC](https://discourse.cmake.org/t/cmake-install-component-how-get-the-list-of-valid-component-to-install/15510/1 "2026-02-14T19:37:28Z")

</div>

[cmdoption-cmake-install-component](https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-install-component) does not help to get list of possible components to install

```auto
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 ...`?](https://discourse.cmake.org/t/how-do-i-list-components-available-with-cmake-install-component/13982)

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [February 17, 2026, 10:28am UTC](https://discourse.cmake.org/t/cmake-install-component-how-get-the-list-of-valid-component-to-install/15510/2 "2026-02-17T10:28:35Z")

</div>

what is this target `list_install_components` for?

```bash
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$ 

```

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [February 17, 2026, 11:25am UTC](https://discourse.cmake.org/t/cmake-install-component-how-get-the-list-of-valid-component-to-install/15510/3 "2026-02-17T11:25:02Z")

</div>

> [@ClausKlein](#):
>
> list\_install\_components

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

```diff
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$ 

```

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 17, 2026, 6:15pm UTC](https://discourse.cmake.org/t/cmake-install-component-how-get-the-list-of-valid-component-to-install/15510/4 "2026-02-17T18:15:25Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [February 17, 2026, 7:34pm UTC](https://discourse.cmake.org/t/cmake-install-component-how-get-the-list-of-valid-component-to-install/15510/5 "2026-02-17T19:34:19Z")

</div>

It works with `Unix Makefiles` generator:

```bash
bash-5.3$ make list_install_components 
Available install components are: "beman.exemplar" "beman.inplace_vector"
bash-5.3$ 

```

```bash
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$ 

```

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [February 17, 2026, 7:39pm UTC](https://discourse.cmake.org/t/cmake-install-component-how-get-the-list-of-valid-component-to-install/15510/6 "2026-02-17T19:39:35Z")

</div>

It looks like `make list_install_components` was added by [CMake commit 7ded253013b6](https://gitlab.kitware.com/cmake/cmake/-/commit/7ded253013b60f7c36b65e0346c658b88f6cffd3) in 2006 but was never documented.

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [March 18, 2026, 7:42am UTC](https://discourse.cmake.org/t/cmake-install-component-how-get-the-list-of-valid-component-to-install/15510/7 "2026-03-18T07:42:22Z")

</div>

I have opened an issue [27703](https://gitlab.kitware.com/cmake/cmake/-/issues/27703)
