Skip to content

Commit d9e2bdf

Browse files
authored
Merge pull request #376 from naturerobots/fix/jenkins-rviz-mbf-plugins
Fix: Jenkins Error rviz_mbf_plugins
2 parents e302cb5 + b288837 commit d9e2bdf

5 files changed

Lines changed: 61 additions & 21 deletions

File tree

rviz_mbf_plugins/CMakeLists.txt

Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,77 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
55
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
66
endif()
77

8-
find_package(ament_cmake_ros REQUIRED)
8+
find_package(ament_cmake REQUIRED)
99

10-
find_package(pluginlib REQUIRED)
1110
find_package(rclcpp REQUIRED)
11+
find_package(rclcpp_action REQUIRED)
12+
find_package(pluginlib REQUIRED)
13+
find_package(geometry_msgs REQUIRED)
1214
find_package(mbf_msgs REQUIRED)
1315
find_package(rviz_common REQUIRED)
1416

15-
qt5_wrap_cpp(MOC_FILES
17+
find_package(Qt5 REQUIRED COMPONENTS Widgets)
18+
19+
20+
set(rviz_mbf_plugins_headers_to_moc
1621
include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp
1722
)
1823

19-
add_library(${PROJECT_NAME}_mbf_goal_actions_panel src/mbf_goal_actions_panel.cpp ${MOC_FILES})
20-
target_include_directories(${PROJECT_NAME}_mbf_goal_actions_panel PUBLIC
24+
foreach(header "${rviz_mbf_plugins_headers_to_moc}")
25+
qt5_wrap_cpp(rviz_mbf_plugins_moc_files "${header}")
26+
endforeach()
27+
28+
add_library(rviz_mbf_plugins SHARED
29+
${rviz_mbf_plugins_moc_files}
30+
src/mbf_goal_actions_panel.cpp
31+
)
32+
33+
target_include_directories(rviz_mbf_plugins PUBLIC
2134
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
2235
$<INSTALL_INTERFACE:include>
2336
)
24-
ament_target_dependencies(${PROJECT_NAME}_mbf_goal_actions_panel
37+
38+
ament_target_dependencies(rviz_mbf_plugins
39+
rclcpp
40+
rclcpp_action
2541
pluginlib
26-
rviz_common
42+
geometry_msgs
2743
mbf_msgs
44+
rviz_common
2845
)
2946

30-
install(TARGETS ${PROJECT_NAME}_mbf_goal_actions_panel
31-
EXPORT export_${PROJECT_NAME}
32-
ARCHIVE DESTINATION lib
33-
LIBRARY DESTINATION lib
34-
RUNTIME DESTINATION bin
47+
target_link_libraries(rviz_mbf_plugins
48+
Qt5::Widgets
3549
)
36-
install(DIRECTORY include/ DESTINATION include)
37-
install(FILES plugins_description.xml
38-
DESTINATION share/${PROJECT_NAME}
50+
51+
target_compile_definitions(rviz_mbf_plugins PRIVATE "RVIZ_MBF_PLUGINS_BUILDING_LIBRARY")
52+
53+
pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)
54+
55+
install(
56+
TARGETS rviz_mbf_plugins
57+
EXPORT export_${PROJECT_NAME}
58+
ARCHIVE DESTINATION lib
59+
LIBRARY DESTINATION lib
60+
RUNTIME DESTINATION bin
61+
)
62+
63+
install(
64+
DIRECTORY include/
65+
DESTINATION include
66+
)
67+
68+
install(
69+
FILES plugins_description.xml
70+
DESTINATION share/${PROJECT_NAME}
3971
)
4072

4173
if(BUILD_TESTING)
4274
find_package(ament_lint_auto REQUIRED)
4375
ament_lint_auto_find_test_dependencies()
4476
endif()
4577

46-
4778
ament_export_include_directories(include)
4879
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
49-
pluginlib_export_plugin_description_file(rviz_common plugins_description.xml)
5080

5181
ament_package()

rviz_mbf_plugins/include/rviz_mbf_plugins/mbf_goal_actions_panel.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class MbfGoalActionsPanel : public rviz_common::Panel
6262

6363
public:
6464
explicit MbfGoalActionsPanel(QWidget * parent = nullptr);
65-
virtual ~MbfGoalActionsPanel() {}
65+
~MbfGoalActionsPanel() noexcept override = default;
6666

6767
void onInitialize() override;
6868
void save(rviz_common::Config config) const override;

rviz_mbf_plugins/package.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,19 @@
1515

1616
<buildtool_depend>ament_cmake</buildtool_depend>
1717

18-
<depend>mbf_msgs</depend>
19-
<depend>pluginlib</depend>
2018
<depend>rclcpp</depend>
19+
<depend>rclcpp_action</depend>
20+
<depend>pluginlib</depend>
21+
<depend>mbf_msgs</depend>
2122
<depend>rviz_common</depend>
23+
<depend>geometry_msgs</depend>
24+
25+
<build_depend>qtbase5-dev</build_depend>
26+
<build_export_depend>qtbase5-dev</build_export_depend>
27+
28+
<exec_depend>libqt5-widgets</exec_depend>
29+
<exec_depend>libqt5-gui</exec_depend>
30+
<exec_depend>libqt5-core</exec_depend>
2231

2332
<test_depend>ament_cmake_auto</test_depend>
2433
<test_depend>ament_cmake_uncrustify</test_depend>

rviz_mbf_plugins/plugins_description.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<library path="rviz_mbf_plugins_mbf_goal_actions_panel">
1+
<library path="rviz_mbf_plugins">
22
<class name="rviz_mbf_plugins/MbfGoalActions"
33
type="rviz_mbf_plugins::MbfGoalActionsPanel"
44
base_class_type="rviz_common::Panel">

rviz_mbf_plugins/src/mbf_goal_actions_panel.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,4 +412,5 @@ void MbfGoalActionsPanel::exePathResultCallback(
412412
} // namespace rviz_mbf_plugins
413413

414414
#include <pluginlib/class_list_macros.hpp>
415+
#include <rviz_common/panel.hpp>
415416
PLUGINLIB_EXPORT_CLASS(rviz_mbf_plugins::MbfGoalActionsPanel, rviz_common::Panel)

0 commit comments

Comments
 (0)