Add rviz build dependency to correctly set linker paths
Description
This seems to fix linking against librviz_default_plugin.so from system packages (melodic) when I actually have a newer version (noetic-devel) in my workspace
Could you explain the actual error a little more? None of the binaries require explicit linking against rviz, do they? Your newer workspace version of librviz* should be included automatically via LD_LIBRARY_PATH, which should be set when you source your workspace. Can you figure out which binary directly loads librviz* from a wrong location and why? Is this related to https://github.com/ros-planning/moveit_tutorials/issues/631 and https://github.com/ros-planning/moveit/pull/2596?
It is "related" in that it took a couple of hours away from my sleep to reproduce the issues mentioned in ros-planning/moveit#2596 but not really otherwise.
There was no more errors than missing linker symbols with interactive markers in /opt/ros/melodic/lib/librviz_default_plugin.so while it was supposed to not use that in the first place but rather the one in my workspace
Here are the error messages
Errors << moveit_tutorials:make /home/sis/Mikado/logs/moveit_tutorials/build.make.035.log
//opt/ros/melodic/lib/librviz_default_plugin.so: undefined reference to `interactive_markers::InteractiveMarkerClient::InteractiveMarkerClient(tf::Transformer&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/sis/Mikado/devel/.private/moveit_tutorials/lib/moveit_tutorials/motion_planning_pipeline_tutorial] Error 1
make[1]: *** [doc/motion_planning_pipeline/CMakeFiles/motion_planning_pipeline_tutorial.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
//opt/ros/melodic/lib/librviz_default_plugin.so: undefined reference to `interactive_markers::InteractiveMarkerClient::InteractiveMarkerClient(tf::Transformer&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/sis/Mikado/devel/.private/moveit_tutorials/lib/moveit_tutorials/motion_planning_api_tutorial] Error 1
make[1]: *** [doc/motion_planning_api/CMakeFiles/motion_planning_api_tutorial.dir/all] Error 2
//opt/ros/melodic/lib/librviz_default_plugin.so: undefined reference to `interactive_markers::InteractiveMarkerClient::InteractiveMarkerClient(tf::Transformer&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/sis/Mikado/devel/.private/moveit_tutorials/lib/moveit_tutorials/move_group_interface_tutorial] Error 1
make[1]: *** [doc/move_group_interface/CMakeFiles/move_group_interface_tutorial.dir/all] Error 2
make: *** [all] Error 2
librviz_default_plugin.so already links against librviz.so:
$ ldd /opt/ros/noetic/lib/librviz_default_plugin.so | grep rviz
librviz.so => /opt/ros/noetic/lib/librviz.so (0x00007fd1ad2de000)
Could you please build in VERBOSE mode and with -j 1 to see the actual command line?
will do that later, the problem is this //opt/ros/melodic/lib/librviz_default_plugin.so should not be used but rather the one in this workspace