ros-perception / vision_opencv

Apache License 2.0
549 stars 601 forks source link

Target "" links to target "rclcpp::rclcpp" but the target was not found. #490

Closed ijnek closed 2 years ago

ijnek commented 2 years ago

Since the last release, a package that depends on cv_bridge started failing with the following error message:

CMake Error at CMakeLists.txt:17 (add_library):
  Target "ros_image_to_qimage" links to target "rclcpp::rclcpp" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?

CMake Error at /opt/ros/rolling/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:50 (add_executable):
  Target "test_ros_image_to_qimage_cpp" links to target "rclcpp::rclcpp" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  /opt/ros/rolling/share/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake:37 (_ament_add_gtest_executable)
  /opt/ros/rolling/share/ament_cmake_gtest/cmake/ament_add_gtest.cmake:68 (ament_add_gtest_executable)
  test/CMakeLists.txt:2 (ament_add_gtest)

Since the other package doesn't use rclcpp at all, I'm going to guess the issue is coming from the changes here.

ijnek commented 2 years ago

I'm suspecting it is related to the changes from https://github.com/ros-perception/vision_opencv/pull/441