From 2c62e2eb3ff1c700ccd79e6853f50aeac9832d8c Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Thu, 13 May 2021 17:53:40 -0700 Subject: [PATCH] CMake: Set Qt autogen properties for Wireshark. It looks like multi-configuration generators (notably MSBuild) need Qt autogen properties set on the wireshark target as well as qtui. Do so unconditionally in both cases. (We were doing so conditionally for qtui before.) --- CMakeLists.txt | 3 +++ ui/qt/CMakeLists.txt | 11 +++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0e8e0602a..3c4fd38cf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2441,6 +2441,9 @@ if(BUILD_wireshark AND QT_FOUND) LINK_FLAGS "${WS_LINK_FLAGS}" FOLDER "Executables" INSTALL_RPATH "${EXECUTABLE_INSTALL_RPATH}" + AUTOMOC ON + AUTOUIC ON + AUTORCC ON ) if(MSVC) set_target_properties(wireshark PROPERTIES LINK_FLAGS_DEBUG "${WS_MSVC_DEBUG_LINK_FLAGS}") diff --git a/ui/qt/CMakeLists.txt b/ui/qt/CMakeLists.txt index 173653ebf4..06d7af30f3 100644 --- a/ui/qt/CMakeLists.txt +++ b/ui/qt/CMakeLists.txt @@ -730,18 +730,13 @@ target_compile_definitions(qtui set_target_properties(qtui PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}" FOLDER "UI" + AUTOMOC ON + AUTOUIC ON + AUTORCC ON # Ensure .qm files are generated before autogenerating i18n.qrc AUTOGEN_TARGET_DEPENDS "${WIRESHARK_QT_QM}" ) -if (NOT CMAKE_AUTOMOC) # Set in the top-level CMakeLists.txt if we're using CMake 3.20.0 or .1 - set_target_properties(qtui PROPERTIES - AUTOMOC ON - AUTOUIC ON - AUTORCC ON - ) -endif() - if(MSVC) set_target_properties(qtui PROPERTIES LINK_FLAGS_DEBUG "${WS_MSVC_DEBUG_LINK_FLAGS}") endif()