@@ -12,7 +12,8 @@ endif()
1212
1313find_package (ament_cmake REQUIRED COMPONENTS rviz )
1414find_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 )
1617find_package (rviz_common REQUIRED )
1718find_package (rviz_ogre_vendor REQUIRED )
1819find_package (rviz_rendering REQUIRED )
@@ -34,7 +35,7 @@ include_directories(include)
3435
3536set (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
6869target_compile_definitions (${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS" )
@@ -73,7 +74,7 @@ pluginlib_export_plugin_description_file(rviz_common plugin_description.xml)
7374ament_export_include_directories (include )
7475ament_export_libraries (${PROJECT_NAME} )
7576ament_export_dependencies (
76- Qt5
77+ Qt${QT_VERSION_MAJOR}
7778 rviz_common
7879 sensor_msgs
7980 tf2
0 commit comments