Compare commits

..

No commits in common. "2626fdcdd4f39e159f3afafc62f0e261152e954c" and "743c5a0ed048a964973d052798b46932ff0a32b1" have entirely different histories.

1 changed files with 5 additions and 15 deletions

View File

@ -1070,7 +1070,6 @@ function(deploy_qt_runtime)
message(WARNING "deploy_qt_runtime: Can't locate the deployqt tool.") message(WARNING "deploy_qt_runtime: Can't locate the deployqt tool.")
return() return()
endif() endif()
set(__bin_dir "$<TARGET_FILE_DIR:${DEPLOY_ARGS_TARGET}>")
set(__is_quick_app FALSE) set(__is_quick_app FALSE)
set(__full_deploy_command "") set(__full_deploy_command "")
if(WIN32) if(WIN32)
@ -1093,7 +1092,7 @@ function(deploy_qt_runtime)
set(__quick_deploy_params set(__quick_deploy_params
--qmldir "${DEPLOY_ARGS_QML_SOURCE_DIR}" --qmldir "${DEPLOY_ARGS_QML_SOURCE_DIR}"
) )
set(__qml_dir "${__bin_dir}/../qml") set(__qml_dir "$<TARGET_FILE_DIR:${DEPLOY_ARGS_TARGET}>/../qml")
if(DEPLOY_ARGS_QML_DEPLOY_DIR) if(DEPLOY_ARGS_QML_DEPLOY_DIR)
set(__qml_dir "${DEPLOY_ARGS_QML_DEPLOY_DIR}") set(__qml_dir "${DEPLOY_ARGS_QML_DEPLOY_DIR}")
endif() endif()
@ -1118,7 +1117,7 @@ function(deploy_qt_runtime)
endif() endif()
set(__extra_deploy_params "") set(__extra_deploy_params "")
if(QT_VERSION VERSION_GREATER_EQUAL "6.5") if(QT_VERSION VERSION_GREATER_EQUAL "6.5")
set(__translations_dir "${__bin_dir}/../translations") set(__translations_dir "$<TARGET_FILE_DIR:${DEPLOY_ARGS_TARGET}>/../translations")
if(DEPLOY_ARGS_TRANSLATION_DEPLOY_DIR) if(DEPLOY_ARGS_TRANSLATION_DEPLOY_DIR)
set(__translations_dir "${DEPLOY_ARGS_TRANSLATION_DEPLOY_DIR}") set(__translations_dir "${DEPLOY_ARGS_TRANSLATION_DEPLOY_DIR}")
endif() endif()
@ -1126,7 +1125,7 @@ function(deploy_qt_runtime)
--translationdir "${__translations_dir}" --translationdir "${__translations_dir}"
) )
endif() endif()
set(__plugins_dir "${__bin_dir}/../plugins") set(__plugins_dir "$<TARGET_FILE_DIR:${DEPLOY_ARGS_TARGET}>/../plugins")
if(DEPLOY_ARGS_PLUGIN_DEPLOY_DIR) if(DEPLOY_ARGS_PLUGIN_DEPLOY_DIR)
set(__plugins_dir "${DEPLOY_ARGS_PLUGIN_DEPLOY_DIR}") set(__plugins_dir "${DEPLOY_ARGS_PLUGIN_DEPLOY_DIR}")
endif() endif()
@ -1137,7 +1136,7 @@ function(deploy_qt_runtime)
set(__full_deploy_params set(__full_deploy_params
$<$<CONFIG:Debug>:--debug> # Sometimes windeployqt can't determine the build type, we tell it explicitly. $<$<CONFIG:Debug>:--debug> # Sometimes windeployqt can't determine the build type, we tell it explicitly.
$<$<NOT:$<CONFIG:Debug>>:--release> # Same as above. $<$<NOT:$<CONFIG:Debug>>:--release> # Same as above.
--libdir "${__bin_dir}" # Explicitly set the library deploy path (where to copy Qt6XXX.dll) because if may be affected by other parameters we use. --libdir "$<TARGET_FILE_DIR:${DEPLOY_ARGS_TARGET}>" # Explicitly set the library deploy path (where to copy Qt6XXX.dll) because if may be affected by other parameters we use.
#--no-translations # It's better to ship Qt translations altogether, otherwise the strings from Qt will stay English. #--no-translations # It's better to ship Qt translations altogether, otherwise the strings from Qt will stay English.
#--no-system-d3d-compiler # QtGui will need d3dcompiler_XX.dll. If we don't ship them, you'll have to make sure the target machine has these libraries. #--no-system-d3d-compiler # QtGui will need d3dcompiler_XX.dll. If we don't ship them, you'll have to make sure the target machine has these libraries.
#--no-compiler-runtime # The target machine may not installed the same MSVC runtime as the develop machine, so it's better to ship it as well. #--no-compiler-runtime # The target machine may not installed the same MSVC runtime as the develop machine, so it's better to ship it as well.
@ -1184,21 +1183,12 @@ function(deploy_qt_runtime)
set(__deploy_target ${DEPLOY_ARGS_TARGET}_deployqt) set(__deploy_target ${DEPLOY_ARGS_TARGET}_deployqt)
add_custom_target(${__deploy_target} add_custom_target(${__deploy_target}
COMMAND ${__full_deploy_command} COMMAND ${__full_deploy_command}
WORKING_DIRECTORY "${__bin_dir}" WORKING_DIRECTORY "$<TARGET_FILE_DIR:${DEPLOY_ARGS_TARGET}>"
COMMENT "Deploying Qt dependencies for target ${DEPLOY_ARGS_TARGET} ..." COMMENT "Deploying Qt dependencies for target ${DEPLOY_ARGS_TARGET} ..."
#VERBATIM # This parameter actually makes our command line unusable ... #VERBATIM # This parameter actually makes our command line unusable ...
) )
# Normally CMake will do this for us automatically, but in case it doesn't ... # Normally CMake will do this for us automatically, but in case it doesn't ...
add_dependencies(${__deploy_target} ${DEPLOY_ARGS_TARGET}) add_dependencies(${__deploy_target} ${DEPLOY_ARGS_TARGET})
set(__qt_conf "${__bin_dir}/qt.conf")
# Without qt.conf, our application won't start, because we don't put plugins
# alongside with our main executable file. We need to explicitly tell Qt where
# to find them.
add_custom_command(TARGET ${__deploy_target} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E echo "[Paths]" > "${__qt_conf}"
COMMAND "${CMAKE_COMMAND}" -E echo "Prefix=.." >> "${__qt_conf}"
COMMENT "Generating qt.conf ..."
)
if(NOT DEPLOY_ARGS_NO_INSTALL) if(NOT DEPLOY_ARGS_NO_INSTALL)
install2(TARGETS ${DEPLOY_ARGS_TARGET}) install2(TARGETS ${DEPLOY_ARGS_TARGET})
if(QT_VERSION VERSION_GREATER_EQUAL "6.3") if(QT_VERSION VERSION_GREATER_EQUAL "6.3")