Skip to content

Explicitly look for Qt6 before Qt5 in Rolling - #1689

Merged
ahcorde merged 1 commit into
ros2:rollingfrom
nbbrooks:nbb/pr-fix-ascending-qt-version-check
Mar 23, 2026
Merged

ahcorde merged 1 commit into
ros2:rollingfrom
nbbrooks:nbb/pr-fix-ascending-qt-version-check

Conversation

@nbbrooks

Copy link
Copy Markdown
Contributor

Description

This fixes an issue with Qt version resolution when both Qt5 and Qt6 are installed and Qt6 should be used. This can happen on 22.04 and 24.04.

CMake defaults to ascending resolution, so when Qt5 and Qt6 are both present, Qt5 will be found first when Qt6 is desired (Rolling, L-Turtle, and beyond). e.g. this pattern find_package(QT NAMES Qt6 Qt5 ...) resolves to Qt5.

The package sort order can be modified, but it is a global setting and IMHO this PR's approach is cleaner.

This pattern causes a problem when rviz_rendering-extras.cmake, etc. run during another package's use of find_package(rviz_common) and it incorrectly resolves to Qt5, which then causes problems because the rviz debian is creating Qt6 widgets, resulting in an INTERFACE_QT_MAJOR_VERSION error.

Is this user-facing behavior change?

Did you use Generative AI?

Claude + Opus 4.6 was used to debug CMake errors

Additional Information

Uncovered as part of moveit/moveit2#3707

… defaults to ascending resolution and Qt5 will be found when Qt6 is desired (Rolling, L-Turtle, and beyond).

This causes a problem when rviz_rendering-extras.cmake, etc. run during find_package(rviz_common) and incorrectly resolve to Qt5.
@ahcorde

ahcorde commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Pulls: #1689
Gist: https://gist.githubusercontent.com/ahcorde/e31f9578e318a906dcf3440025d71ed7/raw/d18ed5a5842476b1f58a4e9191137eb12aa00cc0/ros2.repos
BUILD args: --packages-above-and-dependencies rviz2 rviz_common rviz_default_plugins rviz_rendering rviz_rendering_tests rviz_visual_testing_framework
TEST args: --packages-above rviz2 rviz_common rviz_default_plugins rviz_rendering rviz_rendering_tests rviz_visual_testing_framework
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18612

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde
ahcorde merged commit b48c9a3 into ros2:rolling Mar 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants