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.
This commit is contained in:
Gerald Combs 2021-03-31 11:30:45 -07:00 committed by Wireshark GitLab Utility
parent f4d0273a15
commit a80ea46ff7
2 changed files with 11 additions and 3 deletions

View File

@ -1135,9 +1135,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

@ -630,6 +630,12 @@ set(WIRESHARK_QT_QRC
${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc
)
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