`package.tools.cmake` works with `configs`
@@ -30,11 +30,21 @@ import("lib.detect.find_file")
function install(package, configs)
os.mkdir("build/install")
local oldir = os.cd("build")
+ local argv = {}
+
+ for name, value in pairs(configs) do
+ value = tostring(value):trim()
+ if value ~= "" then
+ table.insert(argv, value)
+ end
+ end
+
if is_plat("windows") and is_arch("x64") then
- os.vrun("cmake -A x64 -DCMAKE_INSTALL_PREFIX=\"%s\" ..", path.absolute("install"))
+ os.vrunv(format("cmake -A x64 -DCMAKE_INSTALL_PREFIX=\"%s\" ..", path.absolute("install")), argv)
else
- os.vrun("cmake -DCMAKE_INSTALL_PREFIX=\"%s\" ..", path.absolute("install"))
+ os.vrunv(format("cmake -DCMAKE_INSTALL_PREFIX=\"%s\" ..", path.absolute("install")), argv)
end
+
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")
