How to install multiple FILE_SET for a library in a generic way?

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?

1 Like

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

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:

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

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/….

2 Likes

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

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
1 Like