build: Windows, run deploy tool only once, use install to install qt depends

Remove unneed . in Qt deploy message
This commit is contained in:
sithlord48 2025-07-18 13:39:32 -04:00 committed by Nick Bolton
parent 9a799294f7
commit 45fcdde636
3 changed files with 15 additions and 6 deletions

View file

@ -38,7 +38,7 @@ macro(configure_libs)
if (WIN32 OR APPLE) if (WIN32 OR APPLE)
find_program(DEPLOYQT ${DEPLOY_TOOL}) find_program(DEPLOYQT ${DEPLOY_TOOL})
if(DEPLOYQT STREQUAL "DEPLOYQT-NOTFOUND") 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() endif()
unset(DEPLOY_TOOL) unset(DEPLOY_TOOL)
endif() endif()

View file

@ -9,10 +9,6 @@ set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .) set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
include(InstallRequiredSystemLibraries) 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) 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) set(CPACK_PRE_BUILD_SCRIPTS ${CMAKE_CURRENT_BINARY_DIR}/pre-cpack.cmake)

View file

@ -72,10 +72,23 @@ if(WIN32)
RUNTIME DESTINATION . RUNTIME DESTINATION .
) )
set(QT_DEPENDS_DIR ${CMAKE_BINARY_DIR}/qt-depends)
add_custom_command( add_custom_command(
TARGET ${target} POST_BUILD TARGET ${target} POST_BUILD
COMMAND ${DEPLOYQT} --no-compiler-runtime --no-system-d3d-compiler --no-quick-import -network $<TARGET_FILE:${target}> COMMAND ${DEPLOYQT}
--no-compiler-runtime
--no-system-d3d-compiler
--no-quick-import
--dir "${QT_DEPENDS_DIR}"
$<TARGET_FILE:${target}>
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different
${QT_DEPENDS_DIR}
$<TARGET_FILE_DIR:${target}>
) )
install(DIRECTORY ${QT_DEPENDS_DIR}/ DESTINATION .)
elseif(APPLE) elseif(APPLE)
set_target_properties(${target} PROPERTIES set_target_properties(${target} PROPERTIES
INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks" INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks"