Skip to content

Commit 373b6da

Browse files
authored
cmake extras: only find Python3 if needed (#479)
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>
1 parent 747b85d commit 373b6da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gz-msgs-extras.cmake.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414

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

17-
find_package(Python3 REQUIRED COMPONENTS Interpreter)
17+
if(NOT TARGET Python3::Interpreter)
18+
find_package(Python3 REQUIRED COMPONENTS Interpreter)
19+
endif()
1820

1921
include(${@PROJECT_NAME@_DIR}/gz_msgs_string_utils.cmake)
2022
include(${@PROJECT_NAME@_DIR}/gz_msgs_protoc.cmake)

0 commit comments

Comments
 (0)