Refactored CMakeDep using always targets instead of lists - #11788
Merged
Merged
Conversation
lasote
commented
Aug 5, 2022
| set(CMAKE_PREFIX_PATH {{ '${' }}{{ pkg_name }}_BUILD_DIRS{{ config_suffix }}} {{ '${' }}CMAKE_PREFIX_PATH}) | ||
|
|
||
| {% if not components_names %} | ||
| ########## GLOBAL TARGET PROPERTIES {{ configuration }} ######################################## |
Contributor
Author
There was a problem hiding this comment.
Sorry for this diff, it is mostly tabulation of the CMake code, I think now it is much more readable and the generated files don't look so bad, actually improves readability too.
lasote
marked this pull request as ready for review
August 5, 2022 13:17
czoido
approved these changes
Aug 8, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changelog: Bugfix: Refactored CMakeDep using always targets instead of lists.
Docs: omit
The bug appeared when components require system libraries, and those were not linked to the
IMPORTEDbut to the component target. CMake was not able to order the system libraries correctly causing linker errors. So it has been fixed using always targets instead of lists, the dependencies of a package/component (such as the system libraries, apple frameworks, and transitive dependencies) are linked to anINTERFACEtarget that later is linked to theIMPORTEDtargets whencpp_info.libsare declared, otherwise to the global or component target.Close #11773