diff options
| author | ruki <[email protected]> | 2018-04-14 23:19:18 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-04-14 23:19:18 +0800 |
| commit | c2534e6c6bee1c54e0dbd7f54d06444d1835c69c (patch) | |
| tree | ee6de4055a7f510bdf1c92e9736cdf4a8c82df9f /xmake/modules/detect | |
| parent | 79c1eb71af25e810d421a790b5e9eab463450cfe (diff) | |
impl find_qt
Diffstat (limited to 'xmake/modules/detect')
| -rw-r--r-- | xmake/modules/detect/sdks/find_qt.lua | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/xmake/modules/detect/sdks/find_qt.lua b/xmake/modules/detect/sdks/find_qt.lua index 73f037315..0eb856994 100644 --- a/xmake/modules/detect/sdks/find_qt.lua +++ b/xmake/modules/detect/sdks/find_qt.lua @@ -31,12 +31,17 @@ function _find_sdkdir() -- init the search directories local pathes = {} if os.host() == "macosx" then - table.insert(pathes, "~/Qt") + table.insert(pathes, "~/Qt/**/bin") elseif os.host() == "windows" then else - table.insert(pathes, "~/Qt") + table.insert(pathes, "~/Qt/**/bin") end + -- attempt to find qmake + local qmake = find_file(os.host() == "windows" and "qmake.exe" or "qmake", pathes) + if qmake then + return path.directory(path.directory(qmake)) + end end -- find qt sdk toolchains @@ -48,7 +53,7 @@ end -- -- @code -- --- local toolchains = find_qt("/Developer/NVIDIA/qt-9.1") +-- local toolchains = find_qt("~/Qt/5.10.1/clang_64") -- -- @endcode -- @@ -67,6 +72,18 @@ function main(sdkdir, opt) return nil end + -- get the bin directory + local bindir = path.join(sdkdir, "bin") + if not os.isexec(path.join(bindir, "qmake")) then + return nil + end + + -- get linkdirs + local linkdirs = {path.join(sdkdir, "lib")} + + -- get includedirs + local includedirs = {path.join(sdkdir, "include")} + -- get toolchains - return {} + return {sdkdir = sdkdir, bindir = bindir, linkdirs = linkdirs, includedirs = includedirs} end |
