summaryrefslogtreecommitdiffstats
path: root/network/wireshark/cmake-3.20.patch
blob: 8200bb63df51112ec520d0dd78a36495f6635289 (plain)
From be2b0fc810fb2f2a80e471138dc29f0cbe87b209 Mon Sep 17 00:00:00 2001
From: Gerald Combs <gerald@wireshark.org>
Date: Fri, 26 Mar 2021 12:52:01 -0700
Subject: [PATCH] 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.
---
 CMakeLists.txt       | 4 ++++
 ui/qt/CMakeLists.txt | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 23a8bd42f9..99ce96ba3c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1132,6 +1132,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 4d5d034d52..2e08d60832 100644
--- a/ui/qt/CMakeLists.txt
+++ b/ui/qt/CMakeLists.txt
@@ -630,10 +630,6 @@ set(WIRESHARK_QT_QRC
 	${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc
 )
 
-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
-- 
GitLab