update opencv (#2347)

* update opencv

* fix opencv

* fix opencv debug on linux
pull/2349/head
Hoildkv 1 year ago committed by GitHub
parent 4628fcd76e
commit 262bad7664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 45
      packages/o/opencv/xmake.lua

@ -6,6 +6,7 @@ package("opencv")
add_urls("https://github.com/opencv/opencv/archive/$(version).tar.gz",
"https://github.com/opencv/opencv.git")
add_versions("4.8.0", "cbf47ecc336d2bff36b0dcd7d6c179a9bb59e805136af6b9670ca944aef889bd")
add_versions("4.6.0", "1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277")
add_versions("4.5.5", "a1cfdcf6619387ca9e232687504da996aaa9f7b5689986b8331ec02cb61d28ad")
add_versions("4.5.4", "c20bb83dd790fc69df9f105477e24267706715a9d3c705ca1e7f613c7b3bad3d")
@ -15,6 +16,7 @@ package("opencv")
add_versions("4.2.0", "9ccb2192d7e8c03c58fee07051364d94ed7599363f3b0dce1c5e6cc11c1bb0ec")
add_versions("3.4.9", "b7ea364de7273cfb3b771a0d9c111b8b8dfb42ff2bcd2d84681902fb8f49892a")
add_resources("4.8.0", "opencv_contrib", "https://github.com/opencv/opencv_contrib/archive/4.8.0.tar.gz", "b4aef0f25a22edcd7305df830fa926ca304ea9db65de6ccd02f6cfa5f3357dbb")
add_resources("4.6.0", "opencv_contrib", "https://github.com/opencv/opencv_contrib/archive/4.6.0.tar.gz", "1777d5fd2b59029cf537e5fd6f8aa68d707075822f90bde683fcde086f85f7a7")
add_resources("4.5.5", "opencv_contrib", "https://github.com/opencv/opencv_contrib/archive/4.5.5.tar.gz", "a97c2eaecf7a23c6dbd119a609c6d7fae903e5f9ff5f1fe678933e01c67a6c11")
add_resources("4.5.4", "opencv_contrib", "https://github.com/opencv/opencv_contrib/archive/4.5.4.tar.gz", "ad74b440b4539619dc9b587995a16b691246023d45e34097c73e259f72de9f81")
@ -27,39 +29,11 @@ package("opencv")
add_configs("bundled", {description = "Build 3rd-party libraries with OpenCV.", default = true, type = "boolean"})
add_configs("tesseract", {description = "Enable tesseract on text module", default = false, type = "boolean"})
local features = {"1394",
"vtk",
"eigen",
"ffmpeg",
"gstreamer",
"gtk",
"ipp",
"halide",
"vulkan",
"jasper",
"openjpeg",
"jpeg",
"webp",
"openexr",
"opengl",
"png",
"tbb",
"tiff",
"itt",
"protobuf",
"quirc"}
local features = {"1394", "vtk", "eigen", "ffmpeg", "gstreamer", "gtk", "ipp", "halide", "vulkan", "jasper", "openjpeg", "jpeg", "webp", "openexr", "opengl", "png", "tbb", "openmp", "tiff", "itt", "protobuf", "quirc", "obsensor"}
local default_features = {"1394", "eigen", "ffmpeg", "jpeg", "opengl", "png", "protobuf", "quirc", "webp", "tiff"}
local function opencv_is_default(feature)
for _, df in ipairs(default_features) do
if feature == df then
return true
end
end
return false
end
for _, feature in ipairs(features) do
add_configs(feature, {description = "Include " .. feature .. " support.", default = opencv_is_default(feature), type = "boolean"})
add_configs(feature, {description = "Include " .. feature .. " support.", default = table.contains(default_features, feature), type = "boolean"})
end
add_configs("blas", {description = "Set BLAS vendor.", values = {"mkl", "openblas"}})
add_configs("cuda", {description = "Enable CUDA support.", default = false, type = "boolean"})
@ -168,10 +142,7 @@ package("opencv")
local reallink = link
if package:is_plat("windows", "mingw") then
reallink = reallink .. package:version():gsub("%.", "")
end
reallink = reallink .. (package:debug() and "d" or "")
if xmake.version():le("2.5.7") and package:is_plat("mingw") and package:config("shared") then
reallink = reallink .. ".dll"
reallink = reallink .. (package:debug() and "d" or "")
end
package:add("links", reallink)
end
@ -219,7 +190,11 @@ package("opencv")
on_test(function (package)
if not package:is_cross() then
os.vrun((package:debug() and "opencv_versiond" or "opencv_version"))
if package:debug() and package:is_plat("windows", "mingw") then
os.vrun("opencv_versiond")
else
os.vrun("opencv_version")
end
end
assert(package:check_cxxsnippets({test = [[
#include <iostream>

Loading…
Cancel
Save