How to create ROS2 library with dependence installed with CMake FetchContent?
I want to create a package that combines the rclcpp libraries and an external library installed with CMake FetchContent. How do I properly create a cmake file? I have already tried different ways, but I keep getting different errors. Here two package for example. An external-lib package contains an external library, and an executor package includes a external-lib package. If I use the command ament_target_dependencies() then I catch the error: ament_target_dependencies() the passed package name 'cli' was not found. If I use the command target_link_libraries() then I catch the error: The following imported targets are referenced, but are missing: cli::cli.
I appreciate your help, thanks!