summaryrefslogtreecommitdiff
path: root/xmake/rules
diff options
context:
space:
mode:
authorruki <[email protected]>2025-11-28 22:31:14 +0800
committerruki <[email protected]>2025-11-28 22:31:14 +0800
commitb186dc3e4f917b820df6729d2054d4bc16f40654 (patch)
treeda149b733bc42f2399b6d77df1083cac382b472c /xmake/rules
parente918f54bb7e5f722ef3ef375809ebcfdaf546ddb (diff)
fix cp dir
Diffstat (limited to 'xmake/rules')
-rw-r--r--xmake/rules/qt/installcmd.lua17
1 files changed, 8 insertions, 9 deletions
diff --git a/xmake/rules/qt/installcmd.lua b/xmake/rules/qt/installcmd.lua
index f9aa87058..705ca9843 100644
--- a/xmake/rules/qt/installcmd.lua
+++ b/xmake/rules/qt/installcmd.lua
@@ -24,7 +24,7 @@ import("rules.qt.install.windeployqt", {rootdir = os.programdir()})
-- install application for xpack
function main(target, batchcmds, opt)
local package = opt.package
-
+
-- only for xpack (package exists)
if not package then
return
@@ -48,15 +48,15 @@ function main(target, batchcmds, opt)
elseif target:is_plat("windows", "mingw") then
-- Windows/Mingw: need to run windeployqt to deploy Qt dependencies
-- First, prepare files in a temporary directory, then copy to package bindir via batchcmds
-
+
-- prepare deployment in a temporary directory
local deploydir = path.join(target:autogendir(), "qt", "deploy", target:name())
os.mkdir(deploydir)
-
+
-- copy target binary to deploydir first
local targetfile = path.join(deploydir, target:filename())
os.cp(target:targetfile(), targetfile)
-
+
-- copy qt.shared deps
local installfiles = {targetfile}
for _, dep in ipairs(target:orderdeps()) do
@@ -69,11 +69,10 @@ function main(target, batchcmds, opt)
-- run windeployqt to deploy Qt dependencies to deploydir
windeployqt.run_deploy(target, deploydir, installfiles)
-
- -- copy all deployed files from deploydir to package bindir via batchcmds
- local package_bindir = package:installdir("bin")
- batchcmds:mkdir(package_bindir)
- batchcmds:cp(path.join(deploydir, "*"), package_bindir, {rootdir = deploydir})
+
+ -- copy all deployed files and directories from deploydir to root install directory via batchcmds
+ local installdir = package:installdir()
+ batchcmds:cp(path.join(deploydir, "*"), installdir, {rootdir = deploydir})
else
-- Linux: copy all files from bindir (plugins, translations, etc. should be handled separately)
local bindir = target:bindir()