From 7f0b8f36e1112e1519edbfb20ae0ee3e9ab4599c Mon Sep 17 00:00:00 2001 From: David Faure Date: Tue, 9 Jul 2024 00:39:13 +0200 Subject: [PATCH] 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 --- tools/linuxdeployqt/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/linuxdeployqt/CMakeLists.txt b/tools/linuxdeployqt/CMakeLists.txt index e4b68927..8ee17277 100644 --- a/tools/linuxdeployqt/CMakeLists.txt +++ b/tools/linuxdeployqt/CMakeLists.txt @@ -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...")