summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2018-04-14 00:03:06 +0800
committerruki <[email protected]>2018-04-14 00:03:06 +0800
commit79c1eb71af25e810d421a790b5e9eab463450cfe (patch)
tree3598846b0024d6609fd6146ed6df6c0cad862fbe /xmake/modules
parenta8a05178346e5efb902aaef8c55264e130389e00 (diff)
add find_qt
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/detect/sdks/find_qt.lua72
1 files changed, 72 insertions, 0 deletions
diff --git a/xmake/modules/detect/sdks/find_qt.lua b/xmake/modules/detect/sdks/find_qt.lua
new file mode 100644
index 000000000..73f037315
--- /dev/null
+++ b/xmake/modules/detect/sdks/find_qt.lua
@@ -0,0 +1,72 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015 - 2018, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file find_qt.lua
+--
+
+-- imports
+import("lib.detect.find_file")
+
+-- find qt sdk directory
+function _find_sdkdir()
+
+ -- init the search directories
+ local pathes = {}
+ if os.host() == "macosx" then
+ table.insert(pathes, "~/Qt")
+ elseif os.host() == "windows" then
+ else
+ table.insert(pathes, "~/Qt")
+ end
+
+end
+
+-- find qt sdk toolchains
+--
+-- @param sdkdir the qt sdk directory
+-- @param opt the argument options
+--
+-- @return the qt sdk toolchains. .e.g {sdkdir = ..., bindir = .., linkdirs = ..., includedirs = ..., .. }
+--
+-- @code
+--
+-- local toolchains = find_qt("/Developer/NVIDIA/qt-9.1")
+--
+-- @endcode
+--
+function main(sdkdir, opt)
+
+ -- init arguments
+ opt = opt or {}
+
+ -- find qt directory
+ if not sdkdir or not os.isdir(sdkdir) then
+ sdkdir = _find_sdkdir()
+ end
+
+ -- not found?
+ if not sdkdir or not os.isdir(sdkdir) then
+ return nil
+ end
+
+ -- get toolchains
+ return {}
+end