Skip to content

Commit 7f0b8f3

Browse files
dfaure-kdabdfaure
andauthored
Fix build with Qt6 (#613)
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]>
1 parent ea89a1f commit 7f0b8f3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/linuxdeployqt/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ add_definitions("-DBUILD_DATE=\"${DATE}\"")
1010
add_definitions("-DBUILD_NUMBER=\"${BUILD_NUMBER}\"")
1111

1212
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
13+
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
1314

1415
# update excludelist
1516
message(STATUS "Updating excludelist...")

0 commit comments

Comments
 (0)