diff options
| author | ruki <[email protected]> | 2019-01-27 22:29:24 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-01-27 22:29:24 +0800 |
| commit | ef61b0b1808551f90ab7b6d09d91c97bcfeb24d0 (patch) | |
| tree | 14255982c69ed17364aa1865b2e6e675af36b91c | |
| parent | 3be9a72ef4c9bcb5c57910321f19a50a74ab754a (diff) | |
do install conan files
| -rw-r--r-- | xmake/modules/package/manager/conan/install_package.lua | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/xmake/modules/package/manager/conan/install_package.lua b/xmake/modules/package/manager/conan/install_package.lua index ce24cda83..114dd6202 100644 --- a/xmake/modules/package/manager/conan/install_package.lua +++ b/xmake/modules/package/manager/conan/install_package.lua @@ -35,11 +35,8 @@ end -- generate conanfile.txt function _generate_conanfile(name, opt) - -- get conanfile.txt - local conanfile = path.join(_get_build_directory(name), "conanfile.txt") - -- trace - dprint("generate %s ..", conanfile) + dprint("generate conanfile.txt ..") -- get conan options and imports local options = table.wrap(opt.options) @@ -47,7 +44,7 @@ function _generate_conanfile(name, opt) local build_requires = table.wrap(opt.build_requires) -- generate it - io.writefile(conanfile, ([[ + io.writefile("conanfile.txt", ([[ [generators] xmake [requires] @@ -76,9 +73,22 @@ function main(name, opt) return false end + -- get build directory + local buildir = _get_build_directory(name) + + -- enter build directory + local oldir = os.cd(buildir) + -- generate conanfile.txt _generate_conanfile(name, opt) + -- install package + local argv = {"install", "."} + os.vrunv(conan.program, argv) + + -- leave build directory + os.cd(oldir) + -- ok --- return true + return true end |
