summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-10-07 00:05:45 +0800
committerruki <[email protected]>2018-10-07 00:05:45 +0800
commitfbc34dadcfdff7f06a1927fbb593503c5149995b (patch)
treec9008e3c62e5f22e5a9e0a261b20d9c6d1b4ce21 /xmake/modules/package/tools/cmake.lua
parent4307ac5dabce5177d1517b0e043a35b5a7c58512 (diff)
add macos and winos version
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
-rw-r--r--xmake/modules/package/tools/cmake.lua17
1 files changed, 13 insertions, 4 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index ae1ecee16..a4c94bc33 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -29,18 +29,27 @@ import("lib.detect.find_file")
-- install package
function install(package, configs)
os.mkdir("build/install")
- os.cd("build")
+ local oldir = os.cd("build")
os.vrun("cmake -a $(arch) -DCMAKE_INSTALL_PREFIX=\"%s\" ..", path.absolute("install"))
if is_host("windows") then
local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!")
os.vrun("msbuild \"%s\" -nologo -t:Rebuild -p:Configuration=%s -p:Platform=%s", slnfile, package:debug() and "Debug" or "Release", is_arch("x64") and "x64" or "Win32")
local projfile = os.isfile("INSTALL.vcxproj") and "INSTALL.vcxproj" or "INSTALL.vcproj"
- os.vrun("msbuild \"%s\" /property:configuration=%s", projfile, package:debug() and "Debug" or "Release")
+ if os.isfile(projfile) then
+ os.vrun("msbuild \"%s\" /property:configuration=%s", projfile, package:debug() and "Debug" or "Release")
+ os.cp("install/lib", package:installdir())
+ os.cp("install/include", package:installdir())
+ else
+ os.cp("**.lib", package:installdir("lib"))
+ os.cp("**.dll", package:installdir("lib"))
+ os.cp("**.exp", package:installdir("lib"))
+ end
else
os.vrun("make -j4")
os.vrun("make install")
+ os.cp("install/lib", package:installdir())
+ os.cp("install/include", package:installdir())
end
- os.cp("install/lib", package:installdir())
- os.cp("install/include", package:installdir())
+ os.cd(oldir)
end