Skip to content

Commit

Permalink
rosidl_adapter/cmake/rosidl_adapt_interfaces.cmake: Make ament free
Browse files Browse the repository at this point in the history
The module FindPython3 already provides the interpreter executable
path via Python3_EXECUTABLE.  No need to use ament.

Less loaded module means faster execution.  And easier for out of tree
build system to reuse this function.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
  • Loading branch information
yashi committed Oct 1, 2022
1 parent 9348ce9 commit 307ef6e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions rosidl_adapter/cmake/rosidl_adapt_interfaces.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@ function(rosidl_adapt_interfaces idl_var arguments_file)
"arguments: ${ARG_UNPARSED_ARGUMENTS}")
endif()

find_package(ament_cmake_core REQUIRED) # for get_executable_path
find_package(Python3 REQUIRED COMPONENTS Interpreter)
get_executable_path(python_interpreter Python3::Interpreter CONFIGURE)

set(idl_output "${CMAKE_CURRENT_BINARY_DIR}/rosidl_adapter/${ARG_TARGET}.idls")
set(cmd
"${python_interpreter}" -m rosidl_adapter
"${Python3_EXECUTABLE}" -m rosidl_adapter
--package-name ${PROJECT_NAME}
--arguments-file "${arguments_file}"
--output-dir "${CMAKE_CURRENT_BINARY_DIR}/rosidl_adapter/${PROJECT_NAME}"
Expand Down

0 comments on commit 307ef6e

Please sign in to comment.