diff --git a/rqt_gui_cpp/CMakeLists.txt b/rqt_gui_cpp/CMakeLists.txt
index 0d63a38d..2b039be9 100644
--- a/rqt_gui_cpp/CMakeLists.txt
+++ b/rqt_gui_cpp/CMakeLists.txt
@@ -24,17 +24,14 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(pluginlib REQUIRED)
-find_package(Qt5Widgets CONFIG REQUIRED)
+find_package(Qt5 REQUIRED COMPONENTS Widgets)
find_package(rclcpp REQUIRED)
-find_package(qt_gui REQUIRED)
find_package(qt_gui_cpp REQUIRED)
ament_export_dependencies(
- Qt5Widgets
- pluginlib
rclcpp
qt_gui_cpp
- qt_gui)
+)
add_library(${PROJECT_NAME} SHARED
src/rqt_gui_cpp/nodelet_plugin_provider.cpp
@@ -48,13 +45,15 @@ if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif()
-ament_target_dependencies(${PROJECT_NAME}
- rclcpp
- Qt5Widgets
- pluginlib
- rclcpp
- qt_gui_cpp
- qt_gui)
+target_link_libraries(${PROJECT_NAME} PUBLIC
+ qt_gui_cpp::qt_gui_cpp
+ rclcpp::rclcpp
+)
+
+target_link_libraries(${PROJECT_NAME} PRIVATE
+ pluginlib::pluginlib
+ Qt5::Widgets
+)
install(
TARGETS ${PROJECT_NAME}
diff --git a/rqt_gui_cpp/package.xml b/rqt_gui_cpp/package.xml
index 2d9e8758..e9e54f40 100644
--- a/rqt_gui_cpp/package.xml
+++ b/rqt_gui_cpp/package.xml
@@ -18,10 +18,8 @@
pluginlib
rclcpp
- qt_gui
qt_gui_cpp
qtbase5-dev
- qt_gui
qt_gui_cpp
diff --git a/rqt_gui_cpp/src/rqt_gui_cpp/nodelet_plugin_provider.cpp b/rqt_gui_cpp/src/rqt_gui_cpp/nodelet_plugin_provider.cpp
index 7e99068a..e36e32b1 100644
--- a/rqt_gui_cpp/src/rqt_gui_cpp/nodelet_plugin_provider.cpp
+++ b/rqt_gui_cpp/src/rqt_gui_cpp/nodelet_plugin_provider.cpp
@@ -34,7 +34,9 @@
#include "roscpp_plugin_provider.h"
+#include
#include
+#include
namespace rqt_gui_cpp {