summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/sdks/find_qt.lua
diff options
context:
space:
mode:
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