Fix the `sysincludedirs` for opencv (homebrew) (#3326)

* fix: also fix opencv `sysincludedirs` for brew

* Update xmake.lua

---------

Co-authored-by: ruki <waruqi@gmail.com>
pull/3332/head
YCG 11 months ago committed by GitHub
parent f7e2429fa2
commit a544e43089
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      packages/o/opencv/xmake.lua

@ -55,13 +55,19 @@ package("opencv")
if opt.system then if opt.system then
local result = package:find_package("brew::opencv", opt) local result = package:find_package("brew::opencv", opt)
if result then if result then
for _, includedir in ipairs(result.sysincludedirs or result.includedirs) do local includedirs = table.wrap(result.sysincludedirs or result.includedirs)
for _, includedir in ipairs(includedirs) do
local dir = path.join(includedir, "opencv4") local dir = path.join(includedir, "opencv4")
if os.isdir(dir) then if os.isdir(dir) then
result.includedirs = table.wrap(result.includedirs) table.insert(includedirs, dir)
table.insert(result.includedirs, dir)
end end
end end
if result.sysincludedirs then
result.sysincludedirs = includedirs
end
if result.includedirs then
result.includedirs = includedirs
end
end end
return result return result
end end

Loading…
Cancel
Save