New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix module CMakeDeps vars and call find_dependency for transitive modules #10227
Fix module CMakeDeps vars and call find_dependency for transitive modules #10227
Conversation
related to https://github.com/conan-io/conan/issues/10224 | ||
modules files variables were set with the pkg_name_FOUND or pkg_name_VERSION | ||
instead of using filename_*, also there was missing doing a find_dependency of the | ||
requires packages to find_package transitive dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice test with clear explanation 👍
set({{ file_name }}_INCLUDE_DIRS {{ '${' + pkg_name + '_INCLUDE_DIRS' + config_suffix + '}' }} ) | ||
set({{ file_name }}_LIBRARIES {{ '${' + pkg_name + '_LIBRARIES' + config_suffix + '}' }} ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if they are defined elsewhere, but it would be very nice to add:
<file_name>_INCLUDE_DIR>
(the no S
flavour of <file_name>_INCLUDE_DIRS>
)
<file_name>_DEFINITIONS>
<file_name>_VERSION_STRING>
Grep _create_cmake_module_variables
in CCI, you'll see that these 3 variables are recurrent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we easily add these @czoido ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll add those 👍
Changelog: Fix: Fix variable names set by
CMakeDeps
modules.Changelog: Fix: Call to
find_dependency
in module mode to find transitive dependencies.Changelog: Feature: Add
<PackageName>_LIBRARIES
,<PackageName>_INCLUDE_DIRS
,<PackageName>_INCLUDE_DIR
,<PackageName>_DEFINITIONS
and<PackageName>_VERSION_STRING
variables in CMakeDeps.Docs: omit
Closes: #10224
When only
cmake_find_mode == "module"
was used in CMakeDeps, transitive dependencies were not correctly found. Also, related with that variable names were not generated correctly.