summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-11-03 22:56:28 +0800
committerruki <[email protected]>2020-11-03 22:56:28 +0800
commit18134874f7834c10e9d62a32ecb0f5da9fe2b683 (patch)
tree3db799c6e98d40689ac090a1320d93c533d08271
parent688efbd2480d197c0f0461f41935e3d2727620de (diff)
improve tools/cmake
-rw-r--r--xmake/modules/package/tools/cmake.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 1c1ab958b..c81958826 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -333,7 +333,7 @@ function _install_for_msvc(package, configs, opt)
end
-- install files for cmake
-function _install_files_for_cmake(package)
+function _install_files_for_cmake(package, opt)
-- patch _IMPORT_PREFIX to the real path
--
@@ -345,6 +345,9 @@ function _install_files_for_cmake(package)
local prefixdir_new = package:installdir()
io.replace(cmakefile, prefixdir_old, prefixdir_new, {plain = true})
end
+ if (opt and opt.binary) or package:kind() == "binary" then
+ os.trycp("install/bin", package:installdir())
+ end
os.trycp("install/lib", package:installdir())
os.trycp("install/include", package:installdir())
end
@@ -368,7 +371,7 @@ function _install_for_make(package, configs, opt)
os.vrunv("make", argv)
os.vrunv("make", {"install"})
end
- _install_files_for_cmake(package)
+ _install_files_for_cmake(package, opt)
end
-- do install for ninja
@@ -382,14 +385,14 @@ function _install_for_ninja(package, configs, opt)
table.insert(argv, "-j")
table.insert(argv, njob)
os.vrunv(ninja.program, argv)
- _install_files_for_cmake(package)
+ _install_files_for_cmake(package, opt)
end
-- do install for cmake/build
function _install_for_cmakebuild(package, configs, opt)
os.vrunv("cmake", {"--build", os.curdir()}, {envs = opt.envs or buildenvs(package)})
os.vrunv("cmake", {"--install", os.curdir()})
- _install_files_for_cmake(package)
+ _install_files_for_cmake(package, opt)
end
-- build package