Skip to content

Make it possible to capture the JSON output of the conan install command(s) #706

@craigscott-crascit

Description

@craigscott-crascit

In the implementation of the conan_install() function, the conan install command output is specified to be in JSON format and is captured to a CMake variable. However, the contents of that variable are not made available to the project in any way. One of the really handy uses of that output is to check which packages ended up being built from source instead of retrieving a pre-built binary package from one of the remotes. It can also be used as part of uploading just-built binary packages when one or more dependencies had to be built-on-demand due to missing binary packages.

One potential complication is where multiple calls to conan_install() are made. Right now, that's the case when a multi-config generator is used. #705 proposed a feature where the project can specify whichever build configuration(s) it wants, including supporting multiple configurations for a single-config generator if they want to. So a feature like what is being proposed here would need some way of saving the results of multiple runs and the project being able to differentiate the separate per-config output.

Perhaps one solution would be to save the output to config-specific files in the output folder. That wouldn't require any new keyword or variable, we could just write these files always. That would certainly help with debugging what's going on with fulfilling dependencies. I use such a file frequently in production projects where I can't currently use cmake-conan, and it would solve some problems I face with those projects that do use cmake-conan.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions