build: unify finding of the qt deploy tool and detect if vcpkg for proper debug build call
This commit is contained in:
parent
a55fafb4fc
commit
9f1c1da1aa
4 changed files with 17 additions and 6 deletions
|
|
@ -33,6 +33,17 @@ macro(configure_libs)
|
||||||
|
|
||||||
find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Widgets Network)
|
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}")
|
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
|
# TODO SSL check can happen in lib/net when don't have to deploy it any longer on windows
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,8 @@
|
||||||
# calling CMAKE_CURRENT_LIST_DIR after include would return the wrong scope var
|
# calling CMAKE_CURRENT_LIST_DIR after include would return the wrong scope var
|
||||||
set(MY_DIR ${CMAKE_CURRENT_LIST_DIR})
|
set(MY_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
# Install depends into our staged copy
|
|
||||||
find_program(MACDEPLOYQT_BIN macdeployqt6)
|
|
||||||
|
|
||||||
install(CODE "execute_process(COMMAND
|
install(CODE "execute_process(COMMAND
|
||||||
${MACDEPLOYQT_BIN}
|
${DEPLOYQT_BIN}
|
||||||
\"\${CMAKE_INSTALL_PREFIX}/Deskflow.app\"
|
\"\${CMAKE_INSTALL_PREFIX}/Deskflow.app\"
|
||||||
-timestamp -codesign=-
|
-timestamp -codesign=-
|
||||||
)")
|
)")
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@ configure_file(
|
||||||
${PROJECT_BINARY_DIR}/src/version.rc @ONLY
|
${PROJECT_BINARY_DIR}/src/version.rc @ONLY
|
||||||
)
|
)
|
||||||
|
|
||||||
# Install Qt Depends to stage
|
|
||||||
find_program(DEPLOYQT windeployqt6)
|
|
||||||
install(CODE "execute_process(
|
install(CODE "execute_process(
|
||||||
COMMAND ${DEPLOYQT} --no-compiler-runtime --no-system-d3d-compiler --no-quick-import -network \"\${CMAKE_INSTALL_PREFIX}/deskflow.exe\"
|
COMMAND ${DEPLOYQT} --no-compiler-runtime --no-system-d3d-compiler --no-quick-import -network \"\${CMAKE_INSTALL_PREFIX}/deskflow.exe\"
|
||||||
)")
|
)")
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,11 @@ if(WIN32)
|
||||||
".*system32.*"
|
".*system32.*"
|
||||||
RUNTIME DESTINATION .
|
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)
|
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"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue