Skip to content

Commit

Permalink
Switch to target_link_libraries. (#297)
Browse files Browse the repository at this point in the history
That way we can split our dependencies into PUBLIC and
PRIVATE.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
  • Loading branch information
clalancette authored Nov 27, 2023
1 parent 43410a6 commit d1dd282
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
23 changes: 11 additions & 12 deletions rqt_gui_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down
2 changes: 0 additions & 2 deletions rqt_gui_cpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
<depend>pluginlib</depend>
<depend>rclcpp</depend>

<build_depend version_gte="0.3.0">qt_gui</build_depend>
<build_depend version_gte="0.3.0">qt_gui_cpp</build_depend>
<build_depend>qtbase5-dev</build_depend>
<exec_depend version_gte="0.3.0">qt_gui</exec_depend>
<exec_depend version_gte="0.3.0">qt_gui_cpp</exec_depend>

<export>
Expand Down
2 changes: 2 additions & 0 deletions rqt_gui_cpp/src/rqt_gui_cpp/nodelet_plugin_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@

#include "roscpp_plugin_provider.h"

#include <memory>
#include <stdexcept>
#include <string>

namespace rqt_gui_cpp {

Expand Down

0 comments on commit d1dd282

Please sign in to comment.