From d5147e92e4642e94e27ff38628b5ce5a7d45fcba Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 9 Mar 2023 23:19:54 +0800 Subject: improve to find qmake from qt5base --- xmake/modules/detect/sdks/find_qt.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xmake/modules/detect/sdks/find_qt.lua b/xmake/modules/detect/sdks/find_qt.lua index 315c57f55..8477a1a02 100644 --- a/xmake/modules/detect/sdks/find_qt.lua +++ b/xmake/modules/detect/sdks/find_qt.lua @@ -126,21 +126,24 @@ function _find_sdkdir(sdkdir, sdkver) if is_host("windows") and is_plat("android") then local qmake = find_file("qmake.bat", paths, {suffixes = subdirs}) if qmake then - return path.directory(path.directory(qmake)), path.filename(qmake) + return path.directory(path.directory(qmake)), qmake end end -- attempt to find qmake local qmake = find_file(is_host("windows") and "qmake.exe" or "qmake", paths, {suffixes = subdirs}) if qmake then - return path.directory(path.directory(qmake)), path.filename(qmake) + return path.directory(path.directory(qmake)), qmake end end -- find qmake function _find_qmake(sdkdir, sdkver) local sdkdir, qmakefile = _find_sdkdir(sdkdir, sdkver) - local qmake = find_tool(qmakefile or "qmake", {paths = sdkdir and path.join(sdkdir, "bin")}) + if qmakefile then + return qmakefile + end + local qmake = find_tool("qmake", {paths = sdkdir and path.join(sdkdir, "bin")}) if qmake then return qmake.program end -- cgit v1.3.1