How to add rviz_plugin to a cmake project
I have a rviz_plugin project, that's used catkin_make build it and can add it in rviz.
But now I have a new need which put the rviz_plugin project in a cmake project. And I used cmake build all project successfully, but when I use the plugin in rviz, it give a bug back.
Bug info like that:
The class required for this panel, 'graph_rviz_plugin/Line graph', could not be loaded. Error: Could not find library corresponding to plugin graph_rviz_plugin/Line graph. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
How can I resolve it? Please give some advices for me, thanks!
Environment
OS Version: Ubuntu 20.04
ROS Distro: [Noetic]