-
Notifications
You must be signed in to change notification settings - Fork 49
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
cmake extras: only find Python3 if needed #479
cmake extras: only find Python3 if needed #479
Conversation
If Python3 has already been found, we shouldn't search again since it may find different components. Signed-off-by: Steve Peters <[email protected]>
testing gz-transport14 with this PR in gazebosim/gz-transport#566 checking that python bindings are built in https://build.osrfoundation.org/job/gz_transport-ci-pr_any-homebrew-amd64/217/ |
I see python tests were run successfully in that build, so I think this fixes the issue |
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.
LGTM!
I ran the following and confirmed that Python3_Development_FOUND
is set to false after the second call to find_package
.
cmake_minimum_required(VERSION 3.5)
project(test_cmake)
include(CMakePrintHelpers)
find_package(Python3 REQUIRED COMPONENTS Development Interpreter)
cmake_print_variables(Python3_Development_FOUND)
cmake_print_variables(Python3_Interpreter_FOUND)
message("Now calling find_package again")
find_package(Python3 REQUIRED COMPONENTS Interpreter)
cmake_print_variables(Python3_Development_FOUND)
cmake_print_variables(Python3_Interpreter_FOUND)
thanks! I meant to clarify what I saw in the gz-transport build logs that made me suspect this was the issue. I'll post it here for posterity. From https://build.osrfoundation.org/job/gz_transport-ci-gz-transport14-noble-amd64/45/:
that second in the test build using this branch, I see the following when finding gz-msgs:
|
🦟 Bug fix
Fixes gz-transport python bindings
Summary
If Python3 has already been found, we shouldn't search again since it may find different components.
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.