diff options
| author | ruki <[email protected]> | 2025-11-28 21:00:05 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-28 21:00:05 +0800 |
| commit | 3f1fd97cb59e469d9374d3d035810ea1d79296a2 (patch) | |
| tree | 1958d28c1c45f4643d0ba41bb145417329b6b9d1 | |
| parent | 90a7323d1b7d910c8e1f7817932ec20a38839888 (diff) | |
fix installdir for pack qt
| -rw-r--r-- | xmake/rules/qt/installcmd.lua | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/xmake/rules/qt/installcmd.lua b/xmake/rules/qt/installcmd.lua index 5fc0a3cf4..73efac91d 100644 --- a/xmake/rules/qt/installcmd.lua +++ b/xmake/rules/qt/installcmd.lua @@ -47,32 +47,28 @@ function main(target, batchcmds, opt) end elseif target:is_plat("windows", "mingw") then -- Windows/Mingw: need to run windeployqt to deploy Qt dependencies - -- First, deploy to target bindir, then copy all files to package bindir + -- First, copy binaries to package bindir, then deploy Qt dependencies - -- get target bindir for deployment - local bindir = assert(target:bindir(), "please use `xmake install -o installdir` or `set_installdir` to set install directory on windows.") + -- get package bindir for deployment + local package_bindir = package:installdir("bin") + os.mkdir(package_bindir) - -- copy target binary to bindir first - local targetfile = path.join(bindir, path.filename(target:targetfile())) + -- copy target binary to package bindir first + local targetfile = path.join(package_bindir, target:filename()) os.cp(target:targetfile(), targetfile) -- copy qt.shared deps local installfiles = {targetfile} for _, dep in ipairs(target:orderdeps()) do if dep:rule("qt.shared") then - local depfile = path.join(bindir, path.filename(dep:targetfile())) + local depfile = path.join(package_bindir, path.filename(dep:targetfile())) os.cp(dep:targetfile(), depfile) table.insert(installfiles, depfile) end end - -- run windeployqt to deploy Qt dependencies to bindir - windeployqt.run_deploy(target, bindir, installfiles) - - -- copy all deployed files from bindir to package bindir - local package_bindir = package:installdir("bin") - batchcmds:mkdir(package_bindir) - batchcmds:cp(path.join(bindir, "*"), package_bindir, {rootdir = bindir}) + -- run windeployqt to deploy Qt dependencies to package bindir + windeployqt.run_deploy(target, package_bindir, installfiles) else -- Linux: copy all files from bindir (plugins, translations, etc. should be handled separately) local bindir = target:bindir() |
