summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-03-29 00:37:21 +0800
committerruki <[email protected]>2019-03-28 21:44:11 +0800
commita704db149ff91df99b2bffe2bd20f89c32d50208 (patch)
treec56d88efc717c0827ebd22595c05c880d015b501
parent3006834c96b0473a718d9067979f971218bedf27 (diff)
install xmake-generator for conan
-rw-r--r--xmake/modules/package/manager/conan/install_package.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/xmake/modules/package/manager/conan/install_package.lua b/xmake/modules/package/manager/conan/install_package.lua
index 197409a9b..98464505b 100644
--- a/xmake/modules/package/manager/conan/install_package.lua
+++ b/xmake/modules/package/manager/conan/install_package.lua
@@ -26,6 +26,7 @@
import("core.base.option")
import("core.project.config")
import("lib.detect.find_tool")
+import("devel.git")
-- get build directory
function _conan_get_build_directory(name)
@@ -58,8 +59,17 @@ xmake
]]):format(name, table.concat(options, "\n"), table.concat(imports, "\n"), table.concat(build_requires, "\n")))
end
+-- install xmake generator
+function _conan_install_xmake_generator(conan)
+ local xmake_generator_localdir = path.join(config.directory(), "conan", "xmake_generator")
+ if not os.isdir(xmake_generator_localdir) then
+ git.clone("https://github.com/xmake-io/conan-xmake_generator.git", {depth = 1, branch = "0.1.0/testing", outputdir = xmake_generator_localdir})
+ os.vrunv(conan.program, {"export", xmake_generator_localdir, "bincrafters/testing"})
+ end
+end
+
-- get configurations
-function configurations(package)
+function configurations()
return
{
build = {description = "use it to choose if you want to build from sources.", default = "all", values = {"all", "never", "missing", "outdated"}},
@@ -100,6 +110,9 @@ function main(name, opt)
-- enter build directory
local oldir = os.cd(buildir)
+ -- install xmake generator
+ _conan_install_xmake_generator(conan)
+
-- generate conanfile.txt
_conan_generate_conanfile(name, opt)