summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/sdks/find_qt.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-05-17 22:08:31 +0800
committerGitHub <[email protected]>2025-05-17 22:08:31 +0800
commit2f8decdc353f4e18de953c074ae8fed1c0969cda (patch)
tree48c8fc85958094ba81f635e6dcaf59f351e88374 /xmake/modules/detect/sdks/find_qt.lua
parentbfef847fcd6f6745b52a9f3c2ab2870dcaf23d16 (diff)
parent2b88ba37fa0a9957b8ab24cf1bf6da59e2c39f21 (diff)
Merge branch 'dev' into unitybuildunitybuild
Diffstat (limited to 'xmake/modules/detect/sdks/find_qt.lua')
-rw-r--r--xmake/modules/detect/sdks/find_qt.lua25
1 files changed, 19 insertions, 6 deletions
diff --git a/xmake/modules/detect/sdks/find_qt.lua b/xmake/modules/detect/sdks/find_qt.lua
index d720ac8b8..29eb65e73 100644
--- a/xmake/modules/detect/sdks/find_qt.lua
+++ b/xmake/modules/detect/sdks/find_qt.lua
@@ -141,7 +141,13 @@ function _find_sdkdir(sdkdir, sdkver)
-- @see https://github.com/xmake-io/xmake/issues/4881
if sdkver then
local major = sdkver:sub(1, 1)
- qmake = find_file("qmake" .. major, paths, {suffixes = subdirs})
+ local suffixes = {major, "-" .. major, "-qt" .. major, ""}
+ for _, suffix in ipairs(suffixes) do
+ qmake = find_file("qmake" .. suffix, paths, {suffixes = subdirs})
+ if qmake then
+ break
+ end
+ end
end
if not qmake then
qmake = find_file("qmake", paths, {suffixes = subdirs})
@@ -167,18 +173,25 @@ function _find_qmake(sdkdir, sdkver)
if sdkver then
sdkver = semver.try_parse(sdkver)
if sdkver then
- local cachekey = "qmake-" .. sdkver:major()
- qmake = find_tool("qmake", {program = "qmake" .. sdkver:major(), cachekey = cachekey, paths = sdkdir and path.join(sdkdir, "bin")})
+ local major = sdkver:major()
+ local suffixes = {major, "-" .. major, "-qt" .. major}
+ for _, suffix in ipairs(suffixes) do
+ local cachekey = "qmake" .. suffix
+ qmake = find_tool("qmake", {program = cachekey, cachekey = cachekey, paths = sdkdir and path.join(sdkdir, "bin")})
+ if qmake then
+ break
+ end
+ end
end
end
-- we need to find the default qmake in current system
-- maybe we only installed qmake6
if not qmake then
- local suffixes = {"", "6", "-qt5"}
+ local suffixes = {"", "6", "-6", "-qt6", "5", "-5", "-qt5"}
for _, suffix in ipairs(suffixes) do
- local cachekey = "qmake-" .. suffix
- qmake = find_tool("qmake", {program = "qmake" .. suffix, cachekey = cachekey, paths = sdkdir and path.join(sdkdir, "bin")})
+ local cachekey = "qmake" .. suffix
+ qmake = find_tool("qmake", {program = cachekey, cachekey = cachekey, paths = sdkdir and path.join(sdkdir, "bin")})
if qmake then
break
end