-
-
Notifications
You must be signed in to change notification settings - Fork 489
opencv: fix build & cmake #8580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @choyy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request aims to resolve build and CMake-related issues encountered with OpenCV, particularly for version 4.12.0. It introduces a new patch for this specific version and modifies the CMake configuration to ensure proper dependency resolution, specifically for the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request addresses a CMake build error by adding a new patch for OpenCV 4.12.0 and correcting a typo in the cmake.install function. Additionally, it modifies the generated OpenCVModules.cmake to include find_dependency(Iconv), which implies a new dependency on libiconv for projects consuming OpenCV. While the typo fix is a good improvement, the implicit dependency on libiconv should be explicitly declared in the opencv package's xmake.lua to ensure proper dependency management.
packages/o/opencv/xmake.lua
Outdated
| io.replace(package:installdir("lib/cmake/opencv4/OpenCVModules.cmake"), | ||
| "opencv_wechat_qrcode\n", | ||
| "opencv_wechat_qrcode\ninclude(CMakeFindDependencyMacro)\nfind_dependency(Iconv)\n", {plain = true}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition of find_dependency(Iconv) in OpenCVModules.cmake indicates that libiconv is now a dependency for OpenCV, specifically for modules like opencv_wechat_qrcode. However, libiconv is not explicitly added as a dependency in the opencv package's on_load function. This can lead to build failures for downstream projects if libiconv is not available or properly managed by xmake. Please add package:add("deps", "libiconv") to ensure this dependency is correctly handled.
packages/o/opencv/xmake.lua
Outdated
| import("package.tools.cmake").install(package, configs, {buildir = "bd", shflags = shflags, ldflags = ldflags}) | ||
| import("package.tools.cmake").install(package, configs, {builddir = "bd", shflags = shflags, ldflags = ldflags}) | ||
|
|
||
| if package:is_plat("linux", "macosx") then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opencv/opencv#20404 (comment)
Maybe related, as for MinGW.
If zxing.hpp is like this (according to contrib resource https://codeload.github.com/opencv/opencv_contrib/tar.gz/refs/tags/4.12.0): That would be if not package:is_plat("windows", "android") ?
#if defined(__ANDROID_API__) || defined(_MSC_VER)
#ifndef NO_ICONV
#define NO_ICONV
#endif
#endifIf we apply lebarsfa/Packages@4b271d2#diff-e13272f82adfb96ae33f958418128ddbc9bd47bc4819f0ddb82ca6358f365bc6 choco/libopencv-dev/tools/no_iconv_mingw.patch that would be if not package:is_plat("windows", "android", "mingw") ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opencv/opencv_contrib#2916 disabled MinGW, opencv/opencv_contrib#2931 enabled MinGW later. Then it would be not package:is_plat("windows", "android"). But I'm not sure if the cmake file is like lib/cmake/opencv4/OpenCVModules.cmake on MinGW.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good, if we could do check by package version for MinGW filter maybe it would be better...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems no version was released during MinGW was disabled?
cmake error: #8484