commit 4adb329c48fdc708f3911e9e785304cb7d1ad6ab Author: Gerald Combs Date: Fri Mar 26 12:52:01 2021 -0700 CMake: Enable AUTO{MOC,UIC,RCC} earlier. Enable CMAKE_AUTOMOC, CMAKE_AUTOUIC, and CMAKE_AUTORCC before searching for Qt packages. This is apparently required for CMake 3.20.0 and later. Fixes #17314. (cherry picked from commit be2b0fc810fb2f2a80e471138dc29f0cbe87b209) Conflicts: ui/qt/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index fc96707896..e99d486711 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1094,6 +1094,10 @@ ws_find_package(Systemd BUILD_sdjournal HAVE_SYSTEMD) # Build the Qt GUI? if(BUILD_wireshark) + set(CMAKE_AUTOMOC ON) + set(CMAKE_AUTOUIC ON) + set(CMAKE_AUTORCC ON) + # Untested, may not work if CMAKE_PREFIX_PATH gets overwritten # somewhere. The if WIN32 in this place is annoying as well. if(WIN32) diff --git a/ui/qt/CMakeLists.txt b/ui/qt/CMakeLists.txt index 20f46802a1..85993a1c71 100644 --- a/ui/qt/CMakeLists.txt +++ b/ui/qt/CMakeLists.txt @@ -611,10 +611,6 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) -set(CMAKE_AUTOMOC TRUE) -set(CMAKE_AUTOUIC TRUE) -set(CMAKE_AUTORCC TRUE) - if(NOT Qt5Widgets_VERSION VERSION_LESS "5.9") # Drop the file modification time of source files from generated files # to help with reproducible builds. We do not use QFileInfo.lastModified