From ed5ccd1ffb0c6937ed133835dc2708521ed51ab8 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Mon, 13 Jul 2026 07:19:37 +0300 Subject: [PATCH] Add windeployqt post-build step for automatic Qt DLL deployment on Windows --- tools/chatgui/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/chatgui/CMakeLists.txt b/tools/chatgui/CMakeLists.txt index 6be0904a..fb814fe8 100644 --- a/tools/chatgui/CMakeLists.txt +++ b/tools/chatgui/CMakeLists.txt @@ -85,6 +85,17 @@ target_compile_definitions(chatgui PRIVATE SQLITE_THREADSAFE=1 USE_SQLITE) set_source_files_properties(db/sqlite3.c transport/chat_core.c transport/chat_sync.c transport/db_sync_stub.c PROPERTIES LANGUAGE C) if(WIN32) target_link_libraries(chatgui PRIVATE ${QT_LIBS} rlottie::rlottie ZLIB::ZLIB OpenSSL::Crypto ZXing::ZXing utun pthread) + if(Qt6_FOUND) + find_program(WINDEPLOYQT windeployqt6 HINTS ${Qt6_DIR}/../../../bin) + else() + find_program(WINDEPLOYQT windeployqt HINTS ${Qt5_DIR}/../../../bin) + endif() + if(WINDEPLOYQT) + add_custom_command(TARGET chatgui POST_BUILD + COMMAND ${WINDEPLOYQT} --no-translations $ + COMMENT "Deploying Qt DLLs alongside executable..." + ) + endif() else() target_link_libraries(chatgui PRIVATE ${QT_LIBS} rlottie::rlottie ZLIB::ZLIB OpenSSL::Crypto ZXing::ZXing utun pthread dl) endif()