Skip to content

Commit

Permalink
Link rclcpp_action if required (#10)
Browse files Browse the repository at this point in the history
* Link rclcpp_action if required

Signed-off-by: Yadunund <[email protected]>

* Update CI

Signed-off-by: Yadunund <[email protected]>

* Update test dep

Signed-off-by: Yadunund <[email protected]>

* Try upgrading

Signed-off-by: Yadunund <[email protected]>

---------

Signed-off-by: Yadunund <[email protected]>
  • Loading branch information
Yadunund authored Aug 2, 2023
1 parent 250d0f8 commit bb28b43
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
docker_image: ['ros:humble-ros-base', 'ros:galactic-ros-base', 'ros:foxy-ros-base']
docker_image: ['ros:humble-ros-base']
container:
image: ${{ matrix.docker_image }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install rustup dependencies
run: |
apt update
Expand All @@ -25,7 +25,8 @@ jobs:
toolchain: stable
- name: rosdep
run: |
apt update && apt upgrade -y
rosdep update
rosdep resolve -q ament_cmake std_msgs example_interfaces rclcpp rclcpp_action | sed '/^#/d' | xargs sudo apt install -y
rosdep resolve -q ament_cmake std_msgs example_interfaces | sed '/^#/d' | xargs sudo apt install -y
- name: cargo test
run: . /ros_entrypoint.sh && cargo test
5 changes: 4 additions & 1 deletion src/cpp/CMakeLists.txt.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ cmake_minimum_required(VERSION 3.16)
project({{project_name}})

find_package(rclcpp REQUIRED)
{% if have_actions -%}
find_package(rclcpp_action REQUIRED)
{%- endif %}
find_package(ament_cmake REQUIRED)
{%- for pkg in packages %}
find_package({{pkg}} REQUIRED)
Expand All @@ -15,7 +18,7 @@ target_include_directories({{project_name}} INTERFACE
{%raw%}${{%endraw%}{{pkg}}_INCLUDE_DIRS}
{%- endfor %}
)
target_link_libraries({{project_name}} INTERFACE rclcpp::rclcpp
target_link_libraries({{project_name}} INTERFACE rclcpp::rclcpp {% if have_actions -%} rclcpp_action::rclcpp_action {%- endif %}
{%- for pkg in packages %}
{%raw%}${{%endraw%}{{pkg}}_LIBRARIES}
{%- endfor %}
Expand Down
1 change: 1 addition & 0 deletions tests/cpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<license>Apache License 2.0</license>

<depend>rclcpp</depend>
<depend>rclcpp_action</depend>
<depend>test_api</depend>

<buildtool_depend>ament_cmake</buildtool_depend>
Expand Down

0 comments on commit bb28b43

Please sign in to comment.