summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-10-12 00:20:24 +0800
committerruki <[email protected]>2021-10-12 00:20:24 +0800
commitb994f9c2c9d883414728b09a5990e10fb47f24c0 (patch)
treefdffef32108edc01381216fab7a8931934d3a9d4
parent9ae2f2130c571d4d7a3a2981de58112b03331b68 (diff)
improve preset for cmake/find_package
-rw-r--r--xmake/modules/package/manager/cmake/find_package.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/xmake/modules/package/manager/cmake/find_package.lua b/xmake/modules/package/manager/cmake/find_package.lua
index 7e9fe1f2b..7c4cc3df0 100644
--- a/xmake/modules/package/manager/cmake/find_package.lua
+++ b/xmake/modules/package/manager/cmake/find_package.lua
@@ -54,10 +54,13 @@ function _find_package(cmake, name, opt)
cmakefile:print("add_cmake_modules(%s)", moduledir)
end
end
+ -- e.g. set(Boost_USE_STATIC_LIB ON)
if opt.presets then
for k, v in ipairs(opt.presets) do
if type(v) == "boolean" then
cmakefile:print("set(%s_%s %s)", name, k, v and "ON" or "OFF")
+ else
+ cmakefile:print("set(%s_%s %s)", name, k, tostring(v))
end
end
end