Skip to content

Commit

Permalink
Use FindPython3 (#118)
Browse files Browse the repository at this point in the history
Signed-off-by: Shane Loretz <[email protected]>
  • Loading branch information
sloretz authored Aug 12, 2021
1 parent feaf7e7 commit 120f4d9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,13 @@ rosidl_write_generator_arguments(
TARGET_DEPENDENCIES ${target_dependencies}
)

find_package(Python3 REQUIRED COMPONENTS Interpreter)

get_used_typesupports(typesupports "rosidl_typesupport_c")
add_custom_command(
OUTPUT ${_generated_sources}
COMMAND ${PYTHON_EXECUTABLE} ${rosidl_typesupport_c_BIN}
COMMAND Python3::Interpreter
ARGS ${rosidl_typesupport_c_BIN}
--generator-arguments-file "${generator_arguments_file}"
--typesupports ${typesupports}
DEPENDS ${target_dependencies}
Expand Down
2 changes: 2 additions & 0 deletions rosidl_typesupport_c/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

<buildtool_depend>ament_cmake_ros</buildtool_depend>

<buildtool_export_depend>python3</buildtool_export_depend>

<depend>rcpputils</depend>
<depend>rcutils</depend>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,13 @@ rosidl_write_generator_arguments(
TARGET_DEPENDENCIES ${target_dependencies}
)

find_package(Python3 REQUIRED COMPONENTS Interpreter)

get_used_typesupports(typesupports "rosidl_typesupport_cpp")
add_custom_command(
OUTPUT ${_generated_sources}
COMMAND ${PYTHON_EXECUTABLE} ${rosidl_typesupport_cpp_BIN}
COMMAND Python3::Interpreter
ARGS ${rosidl_typesupport_cpp_BIN}
--generator-arguments-file "${generator_arguments_file}"
--typesupports ${typesupports}
DEPENDS ${target_dependencies}
Expand Down
2 changes: 2 additions & 0 deletions rosidl_typesupport_cpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

<buildtool_depend>ament_cmake_ros</buildtool_depend>

<buildtool_export_depend>python3</buildtool_export_depend>

<depend>rcpputils</depend>
<build_depend>rosidl_runtime_c</build_depend>
<build_depend>rosidl_typesupport_c</build_depend>
Expand Down

0 comments on commit 120f4d9

Please sign in to comment.