diff options
| author | ruki <[email protected]> | 2018-04-15 21:34:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-04-15 21:34:39 +0800 |
| commit | 4dab3917696d31139166ada278a9b4e4f4e9e4e6 (patch) | |
| tree | f7c1cff0271e21b7e4e311f212743363a6376db9 /xmake/modules/detect | |
| parent | dfb2e572d6ce2675c0a4925f4dee7dd483365ce8 (diff) | |
impl qt console rule with qt sdk
Diffstat (limited to 'xmake/modules/detect')
| -rw-r--r-- | xmake/modules/detect/sdks/find_qt.lua | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/xmake/modules/detect/sdks/find_qt.lua b/xmake/modules/detect/sdks/find_qt.lua index 51aefbf63..6fb7d4b14 100644 --- a/xmake/modules/detect/sdks/find_qt.lua +++ b/xmake/modules/detect/sdks/find_qt.lua @@ -26,13 +26,14 @@ import("lib.detect.cache") import("lib.detect.find_file") import("core.base.option") +import("core.base.global") import("core.project.config") -- find qt sdk directory -function _find_sdkdir() +function _find_sdkdir(sdkdir) -- init the search directories - local pathes = {} + local pathes = {path.join(sdkdir, "**", "bin")} if os.host() == "macosx" then table.insert(pathes, "~/Qt/**/bin") elseif os.host() == "windows" then @@ -51,11 +52,7 @@ end function _find_qt(sdkdir) -- find qt directory - if not sdkdir or not os.isdir(sdkdir) then - sdkdir = _find_sdkdir() - end - - -- not found? + sdkdir = _find_sdkdir(sdkdir) if not sdkdir or not os.isdir(sdkdir) then return nil end @@ -102,11 +99,11 @@ function main(sdkdir, opt) end -- find qt - local qt = _find_qt(sdkdir or config.get("qt_dir")) + local qt = _find_qt(sdkdir or config.get("qt_dir") or global.get("qt_dir")) if qt then -- save sdk directory to config - config.set("qt_dir", qt.sdkdir) + config.set("qt_dir", qt.sdkdir, {force = true, readonly = true}) -- trace if opt.verbose or option.get("verbose") then |
