summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-01-25 00:00:10 +0800
committerruki <[email protected]>2019-01-24 18:01:01 +0800
commitfc20a39a1a046630864ff21d8156dc1e1ca99fb3 (patch)
tree2d8d34873c4d31593b870f095122bf19933f28ee
parentcd683e80b5a6fc2159a97c3cde83bf824ad7294c (diff)
add conan install package
-rw-r--r--xmake/modules/package/manager/brew/install_package.lua6
-rw-r--r--xmake/modules/package/manager/conan/install_package.lua43
-rw-r--r--xmake/modules/package/manager/find_package.lua2
3 files changed, 47 insertions, 4 deletions
diff --git a/xmake/modules/package/manager/brew/install_package.lua b/xmake/modules/package/manager/brew/install_package.lua
index 9f2a4dd92..56b12e50f 100644
--- a/xmake/modules/package/manager/brew/install_package.lua
+++ b/xmake/modules/package/manager/brew/install_package.lua
@@ -28,8 +28,8 @@ import("lib.detect.find_tool")
-- install package
--
--- @param name the package name
--- @param opt the options, .e.g {verbose = true, brew = "the package name"}
+-- @param name the package name, e.g. pcre2, pcre2/libpcre2-8
+-- @param opt the options, .e.g {verbose = true}
--
-- @return true or false
--
@@ -45,7 +45,7 @@ function main(name, opt)
end
-- init argv
- local argv = {"install", opt.brew or name}
+ local argv = {"install", name:split('/')[1]}
if opt.verbose or option.get("verbose") then
table.insert(argv, "--verbose")
end
diff --git a/xmake/modules/package/manager/conan/install_package.lua b/xmake/modules/package/manager/conan/install_package.lua
new file mode 100644
index 000000000..587287e0c
--- /dev/null
+++ b/xmake/modules/package/manager/conan/install_package.lua
@@ -0,0 +1,43 @@
+--!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 - 2019, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file install_package.lua
+--
+
+-- imports
+import("core.base.option")
+import("lib.detect.find_tool")
+
+-- install package
+--
+-- @param name the package name, e.g. conan::OpenSSL/1.0.2n@conan/stable
+-- @param opt the options, .e.g {verbose = true}
+--
+-- @return true or false
+--
+function main(name, opt)
+
+ -- init options
+ opt = opt or {}
+
+ -- ok
+ return true
+end
diff --git a/xmake/modules/package/manager/find_package.lua b/xmake/modules/package/manager/find_package.lua
index 252a33e87..7fec292e5 100644
--- a/xmake/modules/package/manager/find_package.lua
+++ b/xmake/modules/package/manager/find_package.lua
@@ -54,7 +54,7 @@ function _find_package_with_builtin_rule(package_name, opt)
table.insert(managers, "vcpkg")
-- find it from conan (support multi-platforms/architectures)
--- table.insert(managers, "conan")
+ table.insert(managers, "conan")
-- only support the current host platform and architecture
if opt.plat == os.host() and opt.arch == os.arch() and (opt.mode == nil or opt.mode == "release") then