Skip to content

Commit 9069fc0

Browse files
authored
opencv: fix build & cmake (#8580)
* opencv: fix build & cmake * update * update * update * update * trigger ci
1 parent 3b4fd49 commit 9069fc0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/o/opencv/xmake.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
package("opencv")
2-
32
set_homepage("https://opencv.org/")
43
set_description("A open source computer vision library.")
54
set_license("Apache-2.0")
@@ -21,6 +20,7 @@ package("opencv")
2120
add_versions("3.4.9", "b7ea364de7273cfb3b771a0d9c111b8b8dfb42ff2bcd2d84681902fb8f49892a")
2221

2322
add_patches("4.11.0", "https://github.com/opencv/opencv/commit/767dd838d3074409fd72a4d76c320b1370e95943.diff", "376dd90500ab7205084fd4298ff26137ce9678b00233ad20ca2189ef9eca3a58")
23+
add_patches("4.12.0", "https://github.com/opencv/opencv/pull/27691/commits/90c444abd387ffa70b2e72a34922903a2f0f4f5a.patch", "4811cf490195a7b2952e075c4d713593326bc54fcfa42a33e19d7ed025bb5b6f")
2424

2525
add_resources("4.12.0", "opencv_contrib", "https://github.com/opencv/opencv_contrib/archive/4.12.0.tar.gz", "4197722b4c5ed42b476d42e29beb29a52b6b25c34ec7b4d589c3ae5145fee98e")
2626
add_resources("4.11.0", "opencv_contrib", "https://github.com/opencv/opencv_contrib/archive/4.11.0.tar.gz", "2dfc5957201de2aa785064711125af6abb2e80a64e2dc246aca4119b19687041")
@@ -237,7 +237,15 @@ package("opencv")
237237
shflags = {"-Wl,-Bsymbolic"}
238238
end
239239
end
240-
import("package.tools.cmake").install(package, configs, {buildir = "bd", shflags = shflags, ldflags = ldflags})
240+
import("package.tools.cmake").install(package, configs, {builddir = "bd", shflags = shflags, ldflags = ldflags})
241+
242+
if not package:is_plat("windows", "android") then
243+
local cmakefile = os.files(package:installdir("**/OpenCVModules.cmake"))
244+
if cmakefile then
245+
io.replace(cmakefile[1], "opencv_wechat_qrcode\n",
246+
"opencv_wechat_qrcode\ninclude(CMakeFindDependencyMacro)\nfind_dependency(Iconv)\n", {plain = true})
247+
end
248+
end
241249
for _, link in ipairs({"opencv_phase_unwrapping", "opencv_surface_matching", "opencv_saliency",
242250
"opencv_wechat_qrcode", "opencv_mcc", "opencv_face",
243251
"opencv_img_hash", "opencv_videostab", "opencv_structured_light", "opencv_intensity_transform",

0 commit comments

Comments
 (0)