Skip to content
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

CMakeDeps: do not print warnings when alias targets already defined #13527

Conversation

jcar87
Copy link
Contributor

@jcar87 jcar87 commented Mar 24, 2023

Changelog: Bugfix: Remove warnings from defined alias targets in CMakeDeps in case the generated files are processed twice
Docs: Omit

When targets are created with add_library during the workflow of find_package (either when processing a XXX-config.cmake file or FindXXX.cmake one), it is entirely possible (and valid) that the file is processed twice - so it is customary to guard the call to add_library with if (NOT TARGET...).
What's unusual is to print a warning if the target was already defined - especially a regular warning that the consumers cannot do anything about.

This PR aligns these calls with every other invocation of add_library within the CMakeDeps generator - none of the others have a warning in this instance.

@jcar87 jcar87 requested review from czoido and memsharded March 24, 2023 15:21
@CLAassistant
Copy link

CLAassistant commented May 18, 2023

CLA assistant check
All committers have signed the CLA.

@ilya-lavrenov
Copy link

I've also faced with this issue.
Would be great to merge.

@jcar87
Copy link
Contributor Author

jcar87 commented Sep 5, 2023

closed in favour of #14644

@jcar87 jcar87 closed this Sep 5, 2023
@jcar87 jcar87 deleted the bugfix/cmakedeps-alias-targets-redefinition-warning branch September 5, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants