Skip to content

Commit

Permalink
cmake extras: only find Python3 if needed (#479)
Browse files Browse the repository at this point in the history
If Python3 has already been found, we shouldn't search
again since it may find different components.

Signed-off-by: Steve Peters <[email protected]>
(cherry picked from commit 373b6da)
  • Loading branch information
scpeters committed Feb 10, 2025
1 parent d9501cf commit 0a49a58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gz-msgs-extras.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

# copied from gz-msgs/gz-msgs-extras.cmake

find_package(Python3 REQUIRED COMPONENTS Interpreter)
if(NOT TARGET Python3::Interpreter)
find_package(Python3 REQUIRED COMPONENTS Interpreter)
endif()

include(${@PROJECT_NAME@_DIR}/gz_msgs_string_utils.cmake)
include(${@PROJECT_NAME@_DIR}/gz_msgs_protoc.cmake)
Expand Down

0 comments on commit 0a49a58

Please sign in to comment.