Quellcode durchsuchen

[cmake] call windeployqt for all Qt-dependent targets

Andrey Filipenkov vor 4 Wochen
Ursprung
Commit
a07ac419a7
1 geänderte Dateien mit 10 neuen und 6 gelöschten Zeilen
  1. 10 6
      win/CMakeLists.txt

+ 10 - 6
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}/$<TARGET_FILE_NAME:${deployTarget}>\"")
-	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}/$<TARGET_FILE_NAME:${deployTarget}>\"")
+		vcmi_deploy_qt(windeployqt "--no-compiler-runtime ${targetBinary}")
+	endforeach()
 endif()