[workspaces] Add support for sub-projects that use find_package #3330
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using conan workspaces, if a sub-project contains a
find_package
command that points to another sub-project, CMake will fail saying that it cannot find the package.This is expected, because the package will be added as a sub-directory by the top-level CMakeLists.txt file generated by conan.
The presence of
find_package
commands is common in packages that use the conancmake_paths
generator, for example.The recommended solution to this is to re-define
find_package
as a no-op for all sub-projects, which is what this PR implements. See #3302 for more details. Closes #3302Note: System-level packages and other conan dependencies found through
find_package
are unaffected, because they are not in the list of conan workspace packages, hencefind_package
is not redefined for them.Implements #3302.
develop
branch, documenting this one. Also adding a description of the changes in thechangelog.rst
file. https://github.com/conan-io/docs