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 |
azeey
left a comment
There was a problem hiding this comment.
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 createdDetails
|
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
codecheckpassed (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-bymessages.