From a1aeec790fcb5d0ee48861bd09d84ca6231bd05c Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Fri, 27 Jan 2023 16:12:55 +0800 Subject: [PATCH] fix Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- utils.cmake | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/utils.cmake b/utils.cmake index c3c6473..cda656a 100644 --- a/utils.cmake +++ b/utils.cmake @@ -465,7 +465,7 @@ function(deploy_qt_runtime) message(WARNING "deploy_qt_runtime: Can't locate the QMake executable.") return() endif() - get_filename_component(__qt_bin_dir "${QT_QMAKE_EXECUTABLE}" DIRECTORY) + cmake_path(GET "${QT_QMAKE_EXECUTABLE}" PARENT_PATH __qt_bin_dir) find_program(__deploy_tool NAMES windeployqt macdeployqt HINTS "${__qt_bin_dir}") if(NOT EXISTS "${__deploy_tool}") message(WARNING "deploy_qt_runtime: Can't locate the deployqt tool.") @@ -553,15 +553,8 @@ function(deploy_qt_runtime) elseif(UNIX) # TODO endif() - set(__location) - get_target_property(__location ${DEPLOY_ARGS_TARGET} LOCATION) - if(__location) - set(__dir) - cmake_path(GET __location PARENT_PATH __dir) - if(__dir) - file(WRITE "${__dir}/qt.conf" "[Paths]\nPrefix = ..\n") - endif() - endif() + get_target_property(__dir ${DEPLOY_ARGS_TARGET} RUNTIME_OUTPUT_DIRECTORY) + file(WRITE "${__dir}/qt.conf" "[Paths]\nPrefix = ..\n") if(NOT DEPLOY_ARGS_NO_INSTALL) include(GNUInstallDirs) install(TARGETS ${DEPLOY_ARGS_TARGET}