From 45fcdde6364061f015538aebaea81d7c7415ceb5 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Fri, 18 Jul 2025 13:39:32 -0400 Subject: [PATCH] build: Windows, run deploy tool only once, use install to install qt depends Remove unneed . in Qt deploy message --- cmake/Libraries.cmake | 2 +- deploy/windows/deploy.cmake | 4 ---- src/apps/deskflow-gui/CMakeLists.txt | 15 ++++++++++++++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/cmake/Libraries.cmake b/cmake/Libraries.cmake index 9cf5d4d57..d6d1a946e 100644 --- a/cmake/Libraries.cmake +++ b/cmake/Libraries.cmake @@ -38,7 +38,7 @@ macro(configure_libs) if (WIN32 OR APPLE) find_program(DEPLOYQT ${DEPLOY_TOOL}) if(DEPLOYQT STREQUAL "DEPLOYQT-NOTFOUND") - message(FATAL_ERROR "Unable to locate the Qt Deploy Tool: \"${DEPLOY_TOOL}\".") + message(FATAL_ERROR "Unable to locate the Qt Deploy Tool: \"${DEPLOY_TOOL}\"") endif() unset(DEPLOY_TOOL) endif() diff --git a/deploy/windows/deploy.cmake b/deploy/windows/deploy.cmake index d1ebfc356..f25db9672 100644 --- a/deploy/windows/deploy.cmake +++ b/deploy/windows/deploy.cmake @@ -9,10 +9,6 @@ set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE) set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .) include(InstallRequiredSystemLibraries) -install(CODE "execute_process( - COMMAND ${DEPLOYQT} --no-compiler-runtime --no-system-d3d-compiler --no-quick-import -network \"\${CMAKE_INSTALL_PREFIX}/deskflow.exe\" -)") - configure_file(${MY_DIR}/pre-cpack.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/pre-cpack.cmake @ONLY) set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_CURRENT_BINARY_DIR}/pre-cpack.cmake) diff --git a/src/apps/deskflow-gui/CMakeLists.txt b/src/apps/deskflow-gui/CMakeLists.txt index 9d5a417d1..bde38738a 100644 --- a/src/apps/deskflow-gui/CMakeLists.txt +++ b/src/apps/deskflow-gui/CMakeLists.txt @@ -72,10 +72,23 @@ if(WIN32) RUNTIME DESTINATION . ) + set(QT_DEPENDS_DIR ${CMAKE_BINARY_DIR}/qt-depends) + add_custom_command( TARGET ${target} POST_BUILD - COMMAND ${DEPLOYQT} --no-compiler-runtime --no-system-d3d-compiler --no-quick-import -network $ + COMMAND ${DEPLOYQT} + --no-compiler-runtime + --no-system-d3d-compiler + --no-quick-import + --dir "${QT_DEPENDS_DIR}" + $ + COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different + ${QT_DEPENDS_DIR} + $ ) + + install(DIRECTORY ${QT_DEPENDS_DIR}/ DESTINATION .) + elseif(APPLE) set_target_properties(${target} PROPERTIES INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks"