# How can I control from inside my top-level CMakeLists.txt what gets installed with \`cmake --install\`?

**URL:** https://discourse.cmake.org/t/how-can-i-control-from-inside-my-top-level-cmakelists-txt-what-gets-installed-with-cmake-install/13984
**Category:** Usage
**Created:** [April 25, 2025, 12:05pm UTC](https://discourse.cmake.org/t/how-can-i-control-from-inside-my-top-level-cmakelists-txt-what-gets-installed-with-cmake-install/13984 "2025-04-25T12:05:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![exoosh](https://discourse.cmake.org/user_avatar/discourse.cmake.org/exoosh/32/4077_2.png) [@exoosh](https://discourse.cmake.org/u/exoosh)
#### Post date: [April 25, 2025, 12:05pm UTC](https://discourse.cmake.org/t/how-can-i-control-from-inside-my-top-level-cmakelists-txt-what-gets-installed-with-cmake-install/13984/1 "2025-04-25T12:05:19Z")

</div>

I know in theory I can pick the `--component` to install with `cmake --install`; although [I don’t know how to know the component names to pass](https://discourse.cmake.org/t/how-do-i-list-components-available-with-cmake-install-component/13982).

But is there a way to rein in the installation of items from within the top-level `CMakeLists.txt` _without_ cooperation from the subordinate `CMakeLists.txt` files?
