# How to install multiple FILE\_SET for a library in a generic way?

**URL:** https://discourse.cmake.org/t/how-to-install-multiple-file-set-for-a-library-in-a-generic-way/15489
**Category:** Development
**Tags:** gen:ninja
**Created:** [January 31, 2026, 9:07pm UTC](https://discourse.cmake.org/t/how-to-install-multiple-file-set-for-a-library-in-a-generic-way/15489 "2026-01-31T21:07:20Z")
**Posts on this page:** 5
**Page:** 2

<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 9, 2026, 4:17pm UTC](https://discourse.cmake.org/t/how-to-install-multiple-file-set-for-a-library-in-a-generic-way/15489/21 "2026-02-09T16:17:36Z")

</div>

Thanks, that helps.

Q 1: What COMPONENT names should be typically used for HEADERS and CXX\_MODULES?

Q 2: Would it be possible, that instead of sending an error message, `CMake install()` could install the FILE\_SET HEADERS itself to the default DESTINATION?

---

<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 9, 2026, 4:50pm UTC](https://discourse.cmake.org/t/how-to-install-multiple-file-set-for-a-library-in-a-generic-way/15489/22 "2026-02-09T16:50:08Z")

</div>

> [@ClausKlein](#):
>
> Q 1: What COMPONENT names should be typically used for HEADERS and CXX\_MODULES?

`devel` or some variant thereof. They’re useful for development packages (sdks) of the project.

> [@ClausKlein](#):
>
> Q 2: Would it be possible, that instead of sending an error message, `CMake install()` could install the FILE\_SET HEADERS itself to the default DESTINATION?

I’d rather not continue to encourage projects to dump things directly into `$prefix/include` rather than claiming a subdirectory.

---

<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 9, 2026, 7:33pm UTC](https://discourse.cmake.org/t/how-to-install-multiple-file-set-for-a-library-in-a-generic-way/15489/23 "2026-02-09T19:33:31Z")

</div>

> [@ben.boeckel](#):
>
> I’d rather not continue to encourage projects to dump things directly into `$prefix/include` rather than claiming a subdirectory.

Yes, but if it is used like this:

```cmake
target_sources(
    ${TARGET_NAME}
    PUBLIC
        FILE_SET public_headers
            TYPE HEADERS
            BASE_DIRS ${PROJECT_SOURCE_DIR}/include
            FILES
                ${PROJECT_SOURCE_DIR}/include/beman/execution/execution.hpp
                ${PROJECT_SOURCE_DIR}/include/beman/execution/functional.hpp
                ${PROJECT_SOURCE_DIR}/include/beman/execution/stop_token.hpp
                ${PROJECT_SOURCE_DIR}/include/beman/execution26/execution.hpp
                ${PROJECT_SOURCE_DIR}/include/beman/execution26/stop_token.hpp
# ...
)

```

see my PR [#215](https://github.com/bemanproject/execution/pull/215)

---

<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 9, 2026, 7:56pm UTC](https://discourse.cmake.org/t/how-to-install-multiple-file-set-for-a-library-in-a-generic-way/15489/24 "2026-02-09T19:56:44Z")

</div>

The issue here is that `#include <beman/execution/execution.hpp>` works without any `-I` flags (when installed system-wide in a default location). I’d rather see it installed to `/usr/include/beman-executors-1.0/beman/…`.

---

<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 11, 2026, 3:47pm UTC](https://discourse.cmake.org/t/how-to-install-multiple-file-set-for-a-library-in-a-generic-way/15489/25 "2026-02-11T15:47:46Z")

</div>

OK, then for `Boost v1.90.0` I may install i.e.

```bash
tree _CPack_Packages/Darwin/TGZ/boost_any-1.90.0-Darwin
_CPack_Packages/Darwin/TGZ/boost_any-1.90.0-Darwin
├── include
│ └── boost-1.90.0
│ └── boost
│ ├── any
│ │ ├── bad_any_cast.hpp
│ │ ├── basic_any.hpp
│ │ ├── detail
│ │ │ ├── config.hpp
│ │ │ └── placeholder.hpp
│ │ ├── fwd.hpp
│ │ └── unique_any.hpp
│ ├── type_index
│ │ ├── ctti_type_index.hpp
│ │ ├── detail
│ │ │ ├── compile_time_type_info.hpp
│ │ │ ├── config.hpp
│ │ │ ├── ctti_register_class.hpp
│ │ │ └── stl_register_class.hpp
│ │ ├── runtime_cast
│ │ │ ├── boost_shared_ptr_cast.hpp
│ │ │ ├── detail
│ │ │ │ └── runtime_cast_impl.hpp
│ │ │ ├── pointer_cast.hpp
│ │ │ ├── reference_cast.hpp
│ │ │ ├── register_runtime_class.hpp
│ │ │ └── std_shared_ptr_cast.hpp
│ │ ├── runtime_cast.hpp
│ │ ├── stl_type_index.hpp
│ │ └── type_index_facade.hpp
│ └── type_index.hpp
└── lib
    ├── Boost-1.90.0
    │ ├── libboost_any.a
    │ └── libboost_type_index.a
    └── cmake
        ├── boost_any-1.90.0
        │ ├── boost_any-config-version.cmake
        │ ├── boost_any-config.cmake
        │ ├── boost_any-targets-release.cmake
        │ ├── boost_any-targets.cmake
        │ ├── cxx-modules
        │ │ ├── cxx-modules-boost_any-targets-Release.cmake
        │ │ ├── cxx-modules-boost_any-targets.cmake
        │ │ └── target-boost__any-Release.cmake
        │ └── modules
        │ └── modules
        │ └── boost_any.cppm
        ├── boost_assert-1.90.0
        │ ├── boost_assert-config-version.cmake
        │ ├── boost_assert-config.cmake
        │ ├── boost_assert-targets.cmake
        │ └── cxx-modules
        │ └── cxx-modules-boost_assert-targets.cmake
        ├── boost_config-1.90.0
        │ ├── boost_config-config-version.cmake
        │ ├── boost_config-config.cmake
        │ ├── boost_config-targets.cmake
        │ └── cxx-modules
        │ └── cxx-modules-boost_config-targets.cmake
        ├── boost_container_hash-1.90.0
        │ ├── boost_container_hash-config-version.cmake
        │ ├── boost_container_hash-config.cmake
        │ ├── boost_container_hash-targets.cmake
        │ └── cxx-modules
        │ └── cxx-modules-boost_container_hash-targets.cmake
        ├── boost_describe-1.90.0
        │ ├── boost_describe-config-version.cmake
        │ ├── boost_describe-config.cmake
        │ ├── boost_describe-targets.cmake
        │ └── cxx-modules
        │ └── cxx-modules-boost_describe-targets.cmake
        ├── boost_mp11-1.90.0
        │ ├── boost_mp11-config-version.cmake
        │ ├── boost_mp11-config.cmake
        │ ├── boost_mp11-targets.cmake
        │ └── cxx-modules
        │ └── cxx-modules-boost_mp11-targets.cmake
        ├── boost_throw_exception-1.90.0
        │ ├── boost_throw_exception-config-version.cmake
        │ ├── boost_throw_exception-config.cmake
        │ ├── boost_throw_exception-targets.cmake
        │ └── cxx-modules
        │ └── cxx-modules-boost_throw_exception-targets.cmake
        └── boost_type_index-1.90.0
            ├── boost_type_index-config-version.cmake
            ├── boost_type_index-config.cmake
            ├── boost_type_index-targets-release.cmake
            ├── boost_type_index-targets.cmake
            ├── cxx-modules
            │ ├── cxx-modules-boost_type_index-targets-Release.cmake
            │ ├── cxx-modules-boost_type_index-targets.cmake
            │ └── target-boost __type__ index-Release.cmake
            └── modules
                └── modules
                    └── boost_type_index.cppm

33 directories, 63 files

```

[Previous page](https://discourse.cmake.org/t/how-to-install-multiple-file-set-for-a-library-in-a-generic-way/15489.md?page=1)
