Skip to content

Conversation

Aram-Vn
Copy link

@Aram-Vn Aram-Vn commented Feb 17, 2025

Fix Qt6 detection in CMakeLists.txt

Description

This PR improves Qt6 detection in CMakeLists.txt by ensuring that qmake6 is prioritized over qmake and by fixing version comparison logic.

Prioritizes qmake6 over qmake to avoid selecting Qt5.
Adds explicit search paths for Qt6 (/usr/lib/qt6/bin, /usr/bin) to ensure correct detection.
Fixes version comparison by using VERSION_LESS instead of LESS.
Removes trailing whitespace from QT_VERSION to avoid incorrect parsing.

Test Steps

  • Ensure both Qt5 and Qt6 are installed (qmake --version and qmake6 --version).
  • Run cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug and cmake --build build --config Debug
  • Verify that Qt6 is selected (Using Qt version 6.x.x should appear).
  • Build QGroundControl and check for successful compilation.

Checklist:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Aram-Vn Aram-Vn closed this Feb 17, 2025
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.

1 participant