aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2019-03-31 23:44:59 +0800
committerruki <waruqi@gmail.com>2019-03-31 23:44:59 +0800
commitf94bfa4943c7d6cc4932b38a8578d678da978730 (patch)
treec9be9457dbf8e8d7fe00703ff15df081a7c44d38 /README.md
parentf4aaf167e0f2004010b7352a2e3346b8e8eac58c (diff)
downloadxmake-docs-f94bfa4943c7d6cc4932b38a8578d678da978730.tar.gz
xmake-docs-f94bfa4943c7d6cc4932b38a8578d678da978730.zip
update docs
Diffstat (limited to 'README.md')
-rw-r--r--README.md17
1 files changed, 8 insertions, 9 deletions
diff --git a/README.md b/README.md
index 20721a6f..a0cf0c45 100644
--- a/README.md
+++ b/README.md
@@ -991,15 +991,16 @@ Currently this interface supports the following package management support:
And through the system and third-party package management tools for the installation of the dependency package, and then integrated with xmake, for example, we look for an openssl package:
```lua
-import("lib.detect.find_package")
-
-local package = find_package("openssl")
+local packages = find_packages("openssl", "zlib")
```
The returned results are as follows:
```lua
-{links = {"ssl", "crypto", "z"}, linkdirs = {"/usr/local/lib"}, includedirs = {"/usr/local/include"}}
+{
+ {links = {"ssl", "crypto"}, linkdirs = {"/usr/local/lib"}, includedirs = {"/usr/local/include"}},
+ {links = {"z"}, linkdirs = {"/usr/local/lib"}, includedirs = {"/usr/local/include"}}
+}
```
If the search is successful, return a table containing all the package information, if it fails, return nil
@@ -1010,22 +1011,20 @@ The return result here can be directly passed as the parameter of `target:add`,
option("zlib")
    set_showmenu(true)
    before_check(function (option)
-        import("lib.detect.find_package")
-        option:add(find_package("zlib"))
+        option:add(find_packages("openssl", "zlib"))
    end)
```
```lua
target("test")
    on_load(function (target)
-        import("lib.detect.find_package")
-        target:add(find_package("zlib"))
+        target:add(find_packages("openssl", "zlib"))
    end)
```
If third-party tools such as `homebrew`, `pkg-config` are installed on the system, then this interface will try to use them to improve the search results.
-For a more complete description of the usage, please refer to the [lib.detect.find_package](https://xmake.io/#/en/manual?id=detect-find_package) interface documentation.
+For a more complete description of the usage, please refer to the [find_packages](https://xmake.io/#/en/manual?id=find_packages) interface documentation.
##### Homebrew Integration Support