From a07ac419a78e8058df95331f8f435bc664508b3c Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Sun, 21 Sep 2025 17:39:39 +0300 Subject: [PATCH] [cmake] call windeployqt for all Qt-dependent targets --- win/CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/win/CMakeLists.txt b/win/CMakeLists.txt index 8049dfc94..a7075def2 100644 --- a/win/CMakeLists.txt +++ b/win/CMakeLists.txt @@ -1,10 +1,14 @@ # We need to keep this code into separate directory so CMake will execute it after all other subdirectories install code -if(WIN32 AND (ENABLE_LAUNCHER OR ENABLE_EDITOR)) +if(WIN32) + set(deployTargets) if(TARGET vcmilauncher) - set(deployTarget vcmilauncher) - elseif(TARGET vcmieditor) - set(deployTarget vcmieditor) + list(APPEND deployTargets vcmilauncher) endif() - set(targetBinary "\"\${CMAKE_INSTALL_PREFIX}/${BIN_DIR}/$\"") - vcmi_deploy_qt(windeployqt "--no-compiler-runtime ${targetBinary}") + if(TARGET vcmieditor) + list(APPEND deployTargets vcmieditor) + endif() + foreach(deployTarget ${deployTargets}) + set(targetBinary "\"\${CMAKE_INSTALL_PREFIX}/${BIN_DIR}/$\"") + vcmi_deploy_qt(windeployqt "--no-compiler-runtime ${targetBinary}") + endforeach() endif()