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

gz-msgs-extras: Do not call find_package(Python3) if gz-msgs<majVer>_PYTHON_INTERPRETER is defined #466

Closed
wants to merge 1 commit into from

Conversation

traversaro
Copy link
Contributor

@traversaro traversaro commented Oct 2, 2024

🦟 Bug fix

Do not raise error in cross-compilation context if gz-msgs<majorVer>__PYTHON_INTERPRETER is defined.

Summary

When gz-msgs<majorVer>__PYTHON_INTERPRETER is defined, its value will be used instead of Python3::Interpreter. For this reason, it does not make sense to search for Python3 if gz-msgs<majorVer>__PYTHON_INTERPRETER is defined. Moving the find_package there simplifies the cross-compilation of gz packages, as it remove the need for CMake to find a working Python interpeter.

It would be cool (regardless of the value of gz-msgs<majorVer>__PYTHON_INTERPRETER) to only search for Python3 if one project actually calls gz_msgs_generate_messages, and not if a project just call (sometimes transitively) find_package(gz-msgs<majorVer>). However, this would be a more complex change, while the change of this PR is simple and self-contained.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

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.

…PYTHON_INTERPRETER is defined

Signed-off-by: Silvio Traversaro <[email protected]>
@github-actions github-actions bot added the 🏛️ ionic Gazebo Ionic label Oct 2, 2024
@traversaro
Copy link
Contributor Author

It would be cool (regardless of the value of gz-msgs<majorVer>__PYTHON_INTERPRETER) to only search for Python3 if one project actually calls gz_msgs_generate_messages, and not if a project just call (sometimes transitively) find_package(gz-msgs<majorVer>). However, this would be a more complex change, while the change of this PR is simple and self-contained.

Actually I think this is doable, let me close this and open a separate PR for that.

@traversaro traversaro closed this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏛️ ionic Gazebo Ionic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant