-
Notifications
You must be signed in to change notification settings - Fork 31
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 support for adding cmake extras to packages #345
Conversation
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
The approach seems good to me. The only downside I see is that doing |
|
So for example, if |
This is correct. Any downstream users will see your module when they did I would think that the contents of the config extra should be exporting functions/macros, rather than raw cmake code, which should also help with any namespace pollution. |
Sounds good! Probably still wise to have a naming convention that would avoid name clashes. One idea is to use the name of the project as a prefix somewhat like FetchContent. |
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
I think it's probably good to have an idea of one, but I wouldn't want to impose it programmatically in case we ever want to do anything interesting like overriding cmake builtins or overriding gz-cmake functions in downstream packages. |
Signed-off-by: Michael Carroll <[email protected]>
Signed-off-by: Michael Carroll <[email protected]>
🎉 New feature
Closes #331
Summary
This addresses #331 in a slightly different way. Since changing the CMAKE_MODULE_PATH could have strange effects when it comes to resolving cmake files and precedence, this tracks more closely to how
ament_package
allows packages to add cmake functionality.This adds support for a
CONFIG_EXTRAS
argument togz_configure_project
. In here, users can add cmake files (or templates) that will be sourced by all dependent packages.I have added a simple demonstration of how this is expected to work here: gazebosim/gz-utils#97
I will have a more detailed example with the message generation workflow later.
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.