pkg create
で生成されたものに追記する分だけ書いておきます
package.xml
package.xml
<depend>rclcpp</depend>
<depend>libqt5-widgets</depend>
<depend>rviz_common</depend>
<depend>rviz_rendering</depend>
<depend>rviz_ogre_vendor</depend>
この他にプラグイン内でトピックのやりとりをするなら必要なパッケージを追記(例,<depend>std_msgs<\depend>
)
CMakeLists.txt
CMakeLists.txt
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rviz_common REQUIRED)
find_package(rviz_rendering REQUIRED)
find_package(rviz_ogre_vendor REQUIRED)
find_package(pluginlib REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Widgets)
# find_package(std_msgs REQUIRED)
# find_package(geometry_msgs REQUIRED)
include_directories(src ${OGRE_INCLUDE_DIRS} ${OGRE_INCLUDE_DIRS}/Paging)
set(CMAKE_AUTOMOC ON)
add_library(${PROJECT_NAME} SHARED
# src/aaa.cpp
# src/bbb.cpp
# src/ccc.cpp
)
ament_target_dependencies(${PROJECT_NAME}
rclcpp
rviz_common
# std_msgs
# geometry_msgs
)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)
install(TARGETS
${PROJECT_NAME}
EXPORT ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)
package.xmlと同様に必要に応じて追記