CMake: Enable AUTO{MOC,UIC,RCC} according to our CMake version.

As noted in be2b0fc810, we need to set CMAKE_AUTO* before searching for
Qt packages when using 3.20.0 and later. However, this fails if we're
using CMake 3.9.6 or earlier. Set CMAKE_AUTO* where needed depending on
our CMake version.

Ping #17314.

(cherry picked from commit a80ea46ff7)

Conflicts:
	ui/qt/CMakeLists.txt
This commit is contained in:
Gerald Combs 2021-03-31 11:30:45 -07:00 committed by Gerald Combs
parent eee907aeb5
commit 19d03ef4ac
2 changed files with 11 additions and 3 deletions

View File

@ -1115,9 +1115,11 @@ 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)
if(NOT CMAKE_VERSION VERSION_LESS "3.10.0")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
endif()
# Untested, may not work if CMAKE_PREFIX_PATH gets overwritten
# somewhere. The if WIN32 in this place is annoying as well.

View File

@ -631,6 +631,12 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
)
if(CMAKE_VERSION VERSION_LESS "3.10.0")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
endif()
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