# What is the intended use case of the install command line option?

**URL:** https://discourse.cmake.org/t/what-is-the-intended-use-case-of-the-install-command-line-option/452
**Category:** Development
**Created:** [January 5, 2020, 11:24pm UTC](https://discourse.cmake.org/t/what-is-the-intended-use-case-of-the-install-command-line-option/452 "2020-01-05T23:24:42Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![CrustyAuklet](https://discourse.cmake.org/user_avatar/discourse.cmake.org/crustyauklet/32/281_2.png) [@CrustyAuklet](https://discourse.cmake.org/u/CrustyAuklet)
#### Post date: [January 6, 2020, 8:05pm UTC](https://discourse.cmake.org/t/what-is-the-intended-use-case-of-the-install-command-line-option/452/4 "2020-01-06T20:05:17Z")

</div>

I am aware of the different options available for the install option currently. I am asking what it’s intended purpose is because it seems unusable for the use case I imagine, and I assume that I am wrong. I guess I am feeling out a feature request here.

consider my current application. I have a hierarchical project structure like this:

![cmake-structure](https://discourse.cmake.org/uploads/default/original/1X/389348629e44130191cb291da5dc67d973c2c28c.png)

I am assuming here that all sub-projects are nice and assign their install components as dev/runtime. Red projects are _implementation details_ while green projects contribute to the public interface of MyLib. In my actual project there are a few more layers but **LibC** is something like `microsoft-gsl` and thier `gsl::span` is in the interface of **MyLib**. **LibD** is a wonky internal library that nobody would ever want to install into their system but is required for the internal workings of this larger library.

Given this project if I run `cmake --install .` then **ALL** 10 components are installed to the system. In reality a developer would only want  
`cmake --install . --component MyLib_dev --component MyLib_runtime --component libC_dev --component libC_runtime`  
(can we even have multiple component commands?)

Now consider if **MyLib** is actually **MyApp** and **LibA** is a shared library (forgive me for not redrawing). Then what we actually want to install is `cmake --install . --component MyApp_runtime --component libA_runtime`

This makes the `cmake --install` command hard to use correctly, and easy to use incorrectly. It seems like a useful feature would be commands similar to the cpack commands but for wrangling components for the install command. consider `cpack_add_component()` and it’s ability to add dependencies to a component. Consider the following hypothetical commands, where I am really just stealing CPack syntax

```auto
cmake_add_install_type(developer)
cmake_install_component(MyLib_dev
        DEPENDS MyLib_runtime libC_dev
        INSTALL_TYPES developer
)

```

then simply running `cmake --install . --component developer` or maybe `cmake --install . --type developer’.

---

_[View the full topic](https://discourse.cmake.org/t/what-is-the-intended-use-case-of-the-install-command-line-option/452)._
