ros-perception / vision_opencv

Apache License 2.0
549 stars 601 forks source link

export rclcpp as dependency #491

Closed ijnek closed 2 years ago

ijnek commented 2 years ago

In https://github.com/ros-perception/vision_opencv/pull/441, a #include to an rclcpp file was added to a header file, but cv_bridge wasn't exporting it correctly for downstream packages. This causes problems as described in #490.

Resolves: #490

ijnek commented 2 years ago

@wep21 Could you review this please?

wep21 commented 2 years ago

I confirm the problem has been solved by your change. (I have tested it with this sample CMakeLists.txt.)

cmake_minimum_required(VERSION 3.14)
project(test_491)

find_package(cv_bridge REQUIRED)

if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra)
endif()

add_library(${PROJECT_NAME} SHARED
  src/main.cpp
)

target_link_libraries(${PROJECT_NAME}
  cv_bridge::cv_bridge
)

ament_package()

Thank you for fixing it!

ijnek commented 2 years ago

Thanks!