summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-12-05 00:48:46 +0800
committerruki <[email protected]>2020-12-05 00:48:46 +0800
commit028ce30a5de36204f7b402ca76efd7a82186ad33 (patch)
tree74cadb164f41b420aaa8118e4a8d018afa08dcd8 /xmake/modules/package/tools/cmake.lua
parent5f5a91f31793f747dc9d168a627b5d7107aa8107 (diff)
improve cmake/tools
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
-rw-r--r--xmake/modules/package/tools/cmake.lua14
1 files changed, 9 insertions, 5 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 9878a57c8..160568cd1 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -438,7 +438,8 @@ end
-- do build for cmake/build
function _build_for_cmakebuild(package, configs, opt)
- os.vrunv("cmake", {"--build", os.curdir()}, {envs = opt.envs or buildenvs(package)})
+ local cmake = assert(find_tool("cmake"), "cmake not found!")
+ os.vrunv(cmake.program, {"--build", os.curdir()}, {envs = opt.envs or buildenvs(package)})
end
-- do install for msvc
@@ -512,8 +513,9 @@ end
-- do install for cmake/build
function _install_for_cmakebuild(package, configs, opt)
opt = opt or {}
- os.vrunv("cmake", {"--build", os.curdir()}, {envs = opt.envs or buildenvs(package)})
- os.vrunv("cmake", {"--install", os.curdir()})
+ local cmake = assert(find_tool("cmake"), "cmake not found!")
+ os.vrunv(cmake.program, {"--build", os.curdir()}, {envs = opt.envs or buildenvs(package)})
+ os.vrunv(cmake.program, {"--install", os.curdir()})
_install_files_for_cmake(package, opt)
end
@@ -555,7 +557,8 @@ function build(package, configs, opt)
table.insert(argv, oldir)
-- do configure
- os.vrunv("cmake", argv, {envs = opt.envs or buildenvs(package, opt)})
+ local cmake = assert(find_tool("cmake"), "cmake not found!")
+ os.vrunv(cmake.program, argv, {envs = opt.envs or buildenvs(package, opt)})
-- do build
local cmake_generator = opt.cmake_generator
@@ -613,7 +616,8 @@ function install(package, configs, opt)
table.insert(argv, oldir)
-- generate build file
- os.vrunv("cmake", argv, {envs = opt.envs or buildenvs(package, opt)})
+ local cmake = assert(find_tool("cmake"), "cmake not found!")
+ os.vrunv(cmake.program, argv, {envs = opt.envs or buildenvs(package, opt)})
-- do build and install
local cmake_generator = opt.cmake_generator