-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # 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 <scpeters@openrobotics.org>
testing gz-transport14 with this PR in gazebosim/gz-transport#566 checking that python bindings are built in |
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
that second in the test build using this branch, I see the following when finding gz-msgs:
|
https://github.com/Mergifyio backport gz-msgs10 |
✅ Backports have been created
|
If Python3 has already been found, we shouldn't search again since it may find different components. Signed-off-by: Steve Peters <scpeters@openrobotics.org> (cherry picked from commit 373b6da)
If Python3 has already been found, we shouldn't search again since it may find different components. Signed-off-by: Steve Peters <scpeters@openrobotics.org> (cherry picked from commit 373b6da)
🦟 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.