build: unify finding of the qt deploy tool and detect if vcpkg for proper debug build call

This commit is contained in:
sithlord48
2025-01-07 14:33:36 -05:00
committed by Chris Rizzitello
parent a55fafb4fc
commit 9f1c1da1aa
4 changed files with 17 additions and 6 deletions

View File

@ -33,6 +33,17 @@ macro(configure_libs)
find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Widgets Network)
#Define the location of qt deployment tool
if(WIN32)
if (CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT VCPKG_INSTALL_DIR STREQUAL "")
find_program(DEPLOYQT windeployqt.debug.bat)
else()
find_program(DEPLOYQT windeployqt)
endif()
elseif(APPLE)
find_program(DEPLOYQT macdeployqt)
endif()
message(STATUS "Qt version: ${Qt6_VERSION}")
# TODO SSL check can happen in lib/net when don't have to deploy it any longer on windows

View File

@ -5,11 +5,8 @@
# calling CMAKE_CURRENT_LIST_DIR after include would return the wrong scope var
set(MY_DIR ${CMAKE_CURRENT_LIST_DIR})
# Install depends into our staged copy
find_program(MACDEPLOYQT_BIN macdeployqt6)
install(CODE "execute_process(COMMAND
${MACDEPLOYQT_BIN}
${DEPLOYQT_BIN}
\"\${CMAKE_INSTALL_PREFIX}/Deskflow.app\"
-timestamp -codesign=-
)")

View File

@ -12,8 +12,6 @@ configure_file(
${PROJECT_BINARY_DIR}/src/version.rc @ONLY
)
# Install Qt Depends to stage
find_program(DEPLOYQT windeployqt6)
install(CODE "execute_process(
COMMAND ${DEPLOYQT} --no-compiler-runtime --no-system-d3d-compiler --no-quick-import -network \"\${CMAKE_INSTALL_PREFIX}/deskflow.exe\"
)")

View File

@ -76,6 +76,11 @@ if(WIN32)
".*system32.*"
RUNTIME DESTINATION .
)
add_custom_command(
TARGET ${target} POST_BUILD
COMMAND ${DEPLOYQT} --no-compiler-runtime --no-system-d3d-compiler --no-quick-import -network $<TARGET_FILE:${target}>
)
elseif(APPLE)
set_target_properties(${target} PROPERTIES
INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks"