Skip to content

[RQ] Properly exporting targets installed by the build #2

@daminetreg

Description

@daminetreg

Motivation

Plain FetchContent without cmake-tipi-provider is doing an add_subdirectory which makes available all targets to the main project when FetchContent_MakeAvailable(Boost) is called.

In the case of cmake-tipi-provider a call to find_package(boost_filesystem CONFIG REQUIRED) is required because we do the compilation in another CMake build tree and perform an installation to be able to speed up the build and consume cached installed/ trees.

It's possible to bridge both world and provide the ease of FetchContent with the speed of installed/ cache pack without requiring the source code to be always available (cloning the source code of all dependencies for a build is not desirable as it is slow to clone big monorepos like boost, grpc and others and is exactly the value we can provide with FetchContent)

Description

To make this fully transparent we should release and make infer installed cmake packages #564 available, and record installed packages config exported target by parsing out cmake package config file.

Then we could load this information inside cmake-tipi-provider when we resolve the dependency.

Acceptance Criteria

Users of FetchContent with cmake-tipi-provider are not obliged to call find_package to load the targets of the FetchContent'ed installed project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions