Skip to content

Commit

Permalink
Fix build with Qt6 (#613)
Browse files Browse the repository at this point in the history
find_package(QT ...) only finds out if Qt5 or Qt6 is available.
One needs to then to find_package(Qt5...) or find_package(Qt6...) as in
the Qt documentation:
https://doc.qt.io/qt-6/cmake-qt5-and-qt6-compatibility.html

Otherwise, one gets this error:
CMake Error: AUTOMOC for target linuxdeployqt: Could not find moc executable target Qt6::moc
CMake Generate step failed.  Build files cannot be regenerated correctly.

Co-authored-by: David Faure <[email protected]>
  • Loading branch information
dfaure-kdab and dfaure authored Jul 8, 2024
1 parent ea89a1f commit 7f0b8f3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/linuxdeployqt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ add_definitions("-DBUILD_DATE=\"${DATE}\"")
add_definitions("-DBUILD_NUMBER=\"${BUILD_NUMBER}\"")

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)

# update excludelist
message(STATUS "Updating excludelist...")
Expand Down

0 comments on commit 7f0b8f3

Please sign in to comment.