-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add a way to specify link features in CMakeConfigDeps
#19444
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
Add a way to specify link features in CMakeConfigDeps
#19444
Conversation
| # set property allows to append, and lib_info[requires] will iterate | ||
| set_property(TARGET {{lib}} APPEND PROPERTY INTERFACE_LINK_LIBRARIES | ||
| {% if link_info["link_feature"] %} | ||
| "$<LINK_LIBRARY:{{link_info["link_feature"]}},{{config_wrapper(config, require_target)}}>") |
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.
This would need a version check?
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.
what is the minimum CMake that supports this?
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.
3.24 as per https://cmake.org/cmake/help/latest/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.html, which is lower than CMakeConfigDeps so we're ok if I'm not mistaken?
$<LINK_LIBRARY:...> for CMakeConfigDepsCMakeConfigDeps
Co-authored-by: James <memsharded@gmail.com>
Co-authored-by: James <memsharded@gmail.com>
Changelog: Feature: Add a way to specify link features (
$<LINK_LIBRARY:...>) inCMakeConfigDeps.Docs: conan-io/docs#4353
Users are expected to only set the feature where it makes sense (ie, no whole_archive for shared libs)
Closes #19385 if merged