Skip to content

[bug] Workspace package dependencies do not get installed when called from cmake-conan #703

@alex1234567890123456789

Description

Describe the bug

Not sure whether this is technically a bug or feature request but I'm calling it a bug because a user would expect this to work and it does not.

We have a complex setup involving a main project, a few in-house libraries we would like to co-develop with the main project, and a bunch of 3rd party dependencies. The in-house libraries also have their own 3rd party dependencies. The build is triggered by running cmake, which uses cmake-conan to install the dependencies. Multiple profiles are passed to conan, and we have defined our own deployer. We add the subprojects to the main project using FetchContent, as described in the docs.

The FetchContent portion works, but the subproject's dependencies are not installed. I see that there is a workspace super-install command, but our workflow is all cmake-based, and cmake-conan won't call workspace super-install. In addition, super-install doesn't support deployers, so even changing cmake-conan to call super-install won't work.

Really, the question is why there is a separate workspace super-install command? Why can't conan install just add workspace packages to the graph (and disable downloading/building for those packages)? As a user, it doesn't make sense to have multiple install commands that do the same thing (they might be technically different but the intent is the same - install everything I need) but you have to pick the right one depending on whether a project has a workspace or not.

If for some reason the workspace super-install needs to remain a separate command, then it should be updated to support the same options as conan install (add -d, --format, the positional arg for the directory, etc) and cmake-conan should be given the option to call one or the other.

How to reproduce it

Main project: requires zlib
Subproject in workspace: requires geographiclib
Add cmake-conan integration
Add FetchContent to add subproject
cmake configure -> only zlib is installed, and subproject fails to configure because geographiclib can't be found.

Metadata

Metadata

Assignees

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