Skip to content

YAML_CPP_LIBRARIES is empty in ur_calibration causing the yaml-cpp library to be missing while during linking #1294

@razr

Description

@razr

Affected ROS2 Driver version(s)

humble

Used ROS distribution.

Humble

Which combination of platform is the ROS driver running on.

Other

How is the UR ROS2 Driver installed.

Build both the ROS driver and UR Client Library from source

Which robot platform is the driver connected to.

Real robot

Robot SW / URSim version(s)

n/a

How is the ROS driver used.

Others

Issue details

Summary

YAML_CPP_LIBRARIES is empty in ur_calibration causing the yaml-cpp library to be missing during linking

Issue details

I build humble from source and use yaml_cpp_vendor to produce yaml-cpp. And YAML_CPP_LIBRARIES is empty in yaml-cpp-config.cmake.

$ root/share/cmake/yaml-cpp/yaml-cpp-config.cmake
# - Config file for the yaml-cpp package
# It defines the following variables
#  YAML_CPP_INCLUDE_DIR - include directory
#  YAML_CPP_LIBRARIES    - libraries to link against

# Compute paths
get_filename_component(YAML_CPP_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(YAML_CPP_INCLUDE_DIR "")

# Our library dependencies (contains definitions for IMPORTED targets)
include("${YAML_CPP_CMAKE_DIR}/yaml-cpp-targets.cmake")

# These are IMPORTED targets created by yaml-cpp-targets.cmake
set(YAML_CPP_LIBRARIES "")

As a result, linking fails here

target_link_libraries(calibration
  ${YAML_CPP_LIBRARIES}
)

yaml-cpp is defined as an imported target with IMPORTED_LOCATION_RELEASE and CMake expects a project to link against it using:

target_link_libraries(${PROJECT_NAME} yaml-cpp)

Steps to Reproduce

Make simple example to reproduce the issue. Try to remove dependencies to other hardware and software components, if it is possible.

Expected Behavior

yaml-cpp is defined as an imported target with IMPORTED_LOCATION_RELEASE and CMake expects a project to link against it using:

target_link_libraries(${PROJECT_NAME} yaml-cpp)

Even yaml-cpp::yaml-cpp as recommended here

Actual Behavior

see above

Workaround Suggestion

see above

Relevant log output

$ cmake --version
cmake version 3.26.4

Accept Public visibility

  • I agree to make this context public

Metadata

Metadata

Assignees

No one assigned

    Labels

    fix pendingA fix for this issue is pending in an existing PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions