diff options
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index efee315be..d73e3c0e1 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -30,7 +30,14 @@ import("lib.detect.find_file") function install(package, configs) os.mkdir("build/install") local oldir = os.cd("build") - local argv = {} + + local argv = { + "-DCMAKE_INSTALL_PREFIX=\"" .. path.absolute("install") .. "\"" + } + + if is_plat("windows") and is_arch("x64") then + table.insert(argv, "-A x64") + end for name, value in pairs(configs) do value = tostring(value):trim() @@ -39,11 +46,7 @@ function install(package, configs) end end - if is_plat("windows") and is_arch("x64") then - os.vrunv(format("cmake -A x64 -DCMAKE_INSTALL_PREFIX=\"%s\" ..", path.absolute("install")), argv) - else - os.vrunv(format("cmake -DCMAKE_INSTALL_PREFIX=\"%s\" ..", path.absolute("install")), argv) - end + os.vrunv("cmake", argv) if is_host("windows") then local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!") |
