Skip to content

Commit c605574

Browse files
authored
Add Qt6 support (#221)
Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
1 parent 0fc5161 commit c605574

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

rviz_imu_plugin/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ endif()
1212

1313
find_package(ament_cmake REQUIRED COMPONENTS rviz)
1414
find_package(message_filters REQUIRED)
15-
find_package(Qt5 REQUIRED COMPONENTS Widgets Test)
15+
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Test)
16+
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Test)
1617
find_package(rviz_common REQUIRED)
1718
find_package(rviz_ogre_vendor REQUIRED)
1819
find_package(rviz_rendering REQUIRED)
@@ -34,7 +35,7 @@ include_directories(include)
3435

3536
set(dependencies
3637
message_filters
37-
Qt5
38+
Qt${QT_VERSION_MAJOR}
3839
rviz_common
3940
rviz_ogre_vendor
4041
rviz_rendering
@@ -58,11 +59,11 @@ add_library(${PROJECT_NAME} SHARED ${SRC_FILES})
5859
#set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
5960

6061
## Link the library with whatever Qt libraries have been defined by
61-
## the ``find_package(Qt4 ...)`` line above, or by the
62-
## ``set(QT_LIBRARIES Qt5::Widgets)``, and with whatever libraries
62+
## the ``find_package(Qt6 ...)`` line above, or by the
63+
## ``set(QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Widgets)``, and with whatever libraries
6364
## catkin has included.
6465

65-
target_link_libraries(${PROJECT_NAME} PUBLIC rviz_ogre_vendor::OgreMain rviz_ogre_vendor::OgreOverlay Qt5::Widgets ${sensor_msgs_TARGETS} message_filters::message_filters rviz_common::rviz_common rviz_ogre_vendor::OgreMain rviz_rendering::rviz_rendering sensor_msgs::sensor_msgs_library tf2::tf2 tf2_ros::tf2_ros)
66+
target_link_libraries(${PROJECT_NAME} PUBLIC rviz_ogre_vendor::OgreMain rviz_ogre_vendor::OgreOverlay Qt${QT_VERSION_MAJOR}::Widgets ${sensor_msgs_TARGETS} message_filters::message_filters rviz_common::rviz_common rviz_ogre_vendor::OgreMain rviz_rendering::rviz_rendering sensor_msgs::sensor_msgs_library tf2::tf2 tf2_ros::tf2_ros)
6667

6768
# prevent pluginlib from using boost
6869
target_compile_definitions(${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
@@ -73,7 +74,7 @@ pluginlib_export_plugin_description_file(rviz_common plugin_description.xml)
7374
ament_export_include_directories(include)
7475
ament_export_libraries(${PROJECT_NAME})
7576
ament_export_dependencies(
76-
Qt5
77+
Qt${QT_VERSION_MAJOR}
7778
rviz_common
7879
sensor_msgs
7980
tf2

rviz_imu_plugin/package.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<buildtool_depend>ament_cmake</buildtool_depend>
1515

16-
<build_depend>qtbase5-dev</build_depend>
16+
<build_depend>qt6-base-dev</build_depend>
1717

1818
<depend>message_filters</depend>
1919
<depend>pluginlib</depend>
@@ -25,10 +25,10 @@
2525
<depend>tf2</depend>
2626
<depend>tf2_ros</depend>
2727

28-
<exec_depend>libqt5-core</exec_depend>
29-
<exec_depend>libqt5-gui</exec_depend>
30-
<exec_depend>libqt5-opengl</exec_depend>
31-
<exec_depend>libqt5-widgets</exec_depend>
28+
<exec_depend>libqt6-core</exec_depend>
29+
<exec_depend>libqt6gui6t64</exec_depend>
30+
<exec_depend>libqt6opengl6t64</exec_depend>
31+
<exec_depend>libqt6widgets6t64</exec_depend>
3232

3333
<export>
3434
<rosdoc config="${prefix}/rosdoc.yaml"/>

0 commit comments

Comments
 (0)