From 069f35a75c9b0f404d60bfe22e92262e5374a798 Mon Sep 17 00:00:00 2001 From: Ryan Foster Date: Wed, 11 May 2022 15:42:06 -0400 Subject: [PATCH] UI: Find Qt WinExtras only in Qt 5 WinExtras does not exist in Qt 6. Only try to find it and link against it if using Qt 5. --- UI/CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/UI/CMakeLists.txt b/UI/CMakeLists.txt index 22900db43..f4fd39e71 100644 --- a/UI/CMakeLists.txt +++ b/UI/CMakeLists.txt @@ -72,10 +72,15 @@ find_package(CURL REQUIRED) add_subdirectory(frontend-plugins) add_executable(obs) +set(UI_COMPONENTS_WIN "") +if(QT_VERSION EQUAL 5) + set(UI_COMPONENTS_WIN "WinExtras") +endif() + find_qt( VERSION ${QT_VERSION} COMPONENTS Widgets Network Svg Xml - COMPONENTS_WIN WinExtras + COMPONENTS_WIN ${UI_COMPONENTS_WIN} COMPONENTS_LINUX Gui) target_link_libraries(obs PRIVATE Qt::Widgets Qt::Svg Qt::Xml Qt::Network) @@ -338,7 +343,11 @@ if(OS_WINDOWS) win-update/win-update-helpers.hpp ${CMAKE_BINARY_DIR}/obs.rc) - target_link_libraries(obs PRIVATE crypt32 OBS::blake2 Qt::WinExtras) + if(QT_VERSION EQUAL 5) + target_link_libraries(obs PRIVATE crypt32 OBS::blake2 Qt::WinExtras) + else() + target_link_libraries(obs PRIVATE crypt32 OBS::blake2) + endif() target_compile_features(obs PRIVATE cxx_std_17)