Skip to content

Commit

Permalink
Use FindPython3 and make Python dependency explicit (#322)
Browse files Browse the repository at this point in the history
Signed-off-by: Shane Loretz <[email protected]>
  • Loading branch information
sloretz authored Aug 6, 2021
1 parent d514e06 commit eceda75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,12 @@ set(target_dependencies
"resource/pkg_factories.hpp.em"
"ros1_bridge/__init__.py")

find_package(Python3 REQUIRED COMPONENTS Interpreter)

add_custom_command(
OUTPUT ${generated_files}
COMMAND ${PYTHON_EXECUTABLE} bin/ros1_bridge_generate_factories
COMMAND Python3::Interpreter
ARGS bin/ros1_bridge_generate_factories
--output-path "${generated_path}" --template-dir resource
DEPENDS ${target_dependencies}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
Expand Down
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_index_python</buildtool_depend>
<buildtool_depend>python3</buildtool_depend>
<buildtool_depend>python3-catkin-pkg-modules</buildtool_depend>
<buildtool_depend>rosidl_cmake</buildtool_depend>
<buildtool_depend>rosidl_parser</buildtool_depend>
Expand Down

0 comments on commit eceda75

Please sign in to comment.