From f94bfa4943c7d6cc4932b38a8578d678da978730 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 31 Mar 2019 23:44:59 +0800 Subject: update docs --- README.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'README.md') 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 -- cgit v1.2.3