|
@@ -43,6 +43,7 @@ package("opencv")
|
|
|
|
|
|
if is_plat("macosx") then
|
|
if is_plat("macosx") then
|
|
add_frameworks("Foundation", "CoreFoundation", "CoreGraphics", "AppKit", "OpenCL", "Accelerate")
|
|
add_frameworks("Foundation", "CoreFoundation", "CoreGraphics", "AppKit", "OpenCL", "Accelerate")
|
|
|
|
+ add_extsources("brew::opencv")
|
|
elseif is_plat("linux") then
|
|
elseif is_plat("linux") then
|
|
add_extsources("pacman::opencv", "apt::libopencv-dev")
|
|
add_extsources("pacman::opencv", "apt::libopencv-dev")
|
|
add_syslinks("pthread", "dl")
|
|
add_syslinks("pthread", "dl")
|
|
@@ -50,6 +51,22 @@ package("opencv")
|
|
add_syslinks("gdi32", "user32", "glu32", "opengl32", "advapi32", "comdlg32", "ws2_32")
|
|
add_syslinks("gdi32", "user32", "glu32", "opengl32", "advapi32", "comdlg32", "ws2_32")
|
|
end
|
|
end
|
|
|
|
|
|
|
|
+ on_fetch("macosx", function (package, opt)
|
|
|
|
+ if opt.system then
|
|
|
|
+ local result = package:find_package("brew::opencv", opt)
|
|
|
|
+ if result then
|
|
|
|
+ for _, includedir in ipairs(result.sysincludedirs or result.includedirs) do
|
|
|
|
+ local dir = path.join(includedir, "opencv4")
|
|
|
|
+ if os.isdir(dir) then
|
|
|
|
+ result.includedirs = table.wrap(result.includedirs)
|
|
|
|
+ table.insert(result.includedirs, dir)
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+ return result
|
|
|
|
+ end
|
|
|
|
+ end)
|
|
|
|
+
|
|
on_load("linux", "macosx", "windows", "mingw@windows,msys", function (package)
|
|
on_load("linux", "macosx", "windows", "mingw@windows,msys", function (package)
|
|
if package:is_plat("windows") then
|
|
if package:is_plat("windows") then
|
|
local arch = "x64"
|
|
local arch = "x64"
|