diff --git a/CMakeModules/CopyCitronQt6Deps.cmake b/CMakeModules/CopyCitronQt6Deps.cmake index 3e5748f10..f4e1771d9 100644 --- a/CMakeModules/CopyCitronQt6Deps.cmake +++ b/CMakeModules/CopyCitronQt6Deps.cmake @@ -13,10 +13,12 @@ function(copy_citron_Qt6_deps target_dir) set(Qt6_PLATFORMS_DIR "${Qt6_DIR}/../../../plugins/platforms/") set(Qt6_STYLES_DIR "${Qt6_DIR}/../../../plugins/styles/") set(Qt6_IMAGEFORMATS_DIR "${Qt6_DIR}/../../../plugins/imageformats/") + set(Qt6_TLS_DIR "${Qt6_DIR}/../../../plugins/tls/") set(Qt6_RESOURCES_DIR "${Qt6_DIR}/../../../resources/") set(PLATFORMS ${DLL_DEST}plugins/platforms/) set(STYLES ${DLL_DEST}plugins/styles/) set(IMAGEFORMATS ${DLL_DEST}plugins/imageformats/) + set(TLS ${DLL_DEST}tls/) if (MSVC) windows_copy_files(${target_dir} ${Qt6_DLL_DIR} ${DLL_DEST} @@ -50,6 +52,11 @@ function(copy_citron_Qt6_deps target_dir) qjpeg$<$:d>.* qgif$<$:d>.* ) + # Copy TLS plugins for SSL/HTTPS support (required for auto updater) + windows_copy_files(citron ${Qt6_TLS_DIR} ${TLS} + qschannelbackend$<$:d>.* + qopensslbackend$<$:d>.* + ) else() # Update for non-MSVC platforms if needed endif() diff --git a/src/citron/CMakeLists.txt b/src/citron/CMakeLists.txt index dfca26cb1..efa38e944 100644 --- a/src/citron/CMakeLists.txt +++ b/src/citron/CMakeLists.txt @@ -512,38 +512,6 @@ if (WIN32 AND QT_VERSION VERSION_GREATER_EQUAL 6) COMMAND ${CMAKE_COMMAND} -E make_directory "${CITRON_EXE_DIR}/user" COMMENT "Creating portable user directory" ) - - # Copy Qt TLS plugins for SSL/TLS support (required for auto updater and HTTPS) - # Qt 6 uses a plugin architecture for TLS backends - if (CITRON_USE_AUTO_UPDATER OR ENABLE_OPENSSL) - set(Qt6_TLS_PLUGINS_DIR "${Qt6_DIR}/../../../plugins/tls") - - # Create tls directory - add_custom_command(TARGET citron POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory "${CITRON_EXE_DIR}/tls" - COMMENT "Creating TLS plugin directory for SSL support" - ) - - # Copy Windows native Schannel backend (no external dependencies) - if (EXISTS "${Qt6_TLS_PLUGINS_DIR}/qschannelbackend.dll") - add_custom_command(TARGET citron POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${Qt6_TLS_PLUGINS_DIR}/qschannelbackend.dll" - "${CITRON_EXE_DIR}/tls/qschannelbackend.dll" - COMMENT "Copying Qt Schannel TLS plugin (Windows native SSL)" - ) - endif() - - # Copy OpenSSL backend as fallback (requires OpenSSL DLLs) - if (EXISTS "${Qt6_TLS_PLUGINS_DIR}/qopensslbackend.dll") - add_custom_command(TARGET citron POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${Qt6_TLS_PLUGINS_DIR}/qopensslbackend.dll" - "${CITRON_EXE_DIR}/tls/qopensslbackend.dll" - COMMENT "Copying Qt OpenSSL TLS plugin (fallback)" - ) - endif() - endif() endif() if (CITRON_USE_BUNDLED_QT)