-
-
Notifications
You must be signed in to change notification settings - Fork 24
Enhance README and CMakeLists for OpenCV module customization #355
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: main
Are you sure you want to change the base?
Conversation
- Added documentation on customizing OpenCV modules via `opencv_config.cmake` in both `opencv_core` and `opencv_dart` READMEs. - Updated `CMakeLists.txt` in both packages to include user-defined configurations if `opencv_config.cmake` exists, falling back to default settings otherwise.
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #355 +/- ##
=======================================
Coverage 93.26% 93.26%
=======================================
Files 50 50
Lines 10266 10266
=======================================
Hits 9575 9575
Misses 691 691
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
also i dont know how to handle that in case of macos and ios :) i guess even that will be fixed by native assets |
@abdelaziz-mahdy the solution is doable but also dangerous, Actually even though #313 is opened, no many demands received for now, and just like you mentioned, it will be solved by native-assets, therefore I didn't active to solve it.
This will be easier, we can only provide # <project>/ios/Podfile
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
pod 'DartCvIOS/imgproc' '4.11.0.2' # add this
end
# ... So in summary, if we want to support the optional modules from now, I would also prefer parsing the specific options in hooks:
user_defines:
dartcv4:
exclude_modules:
- contrib
- dnn
- features2d which means we need to parse yaml or at least filter the needed options in CMakelists.txt. |
Oh actually I really didn't consider the malicious intents in my implementation Yaml will require parsing and generation of cmake options based on it Will check if I am able to do it or not, but I didn't understand the iOS/macos parts |
Yes, you can try to ask GPT or claude from some help.
currently, the full dependency of |
- Updated README files for both `opencv_core` and `opencv_dart` to reflect the new method of customizing OpenCV modules via the `pubspec.yaml` file instead of `opencv_config.cmake`. - Introduced a Dart script to generate `dartcv_modules.cmake` based on the specified modules in `pubspec.yaml`. - Modified `CMakeLists.txt` in both packages to include the generated `dartcv_modules.cmake`, ensuring proper module configuration during the build process.
I played around with ai/cursor to create the yaml parser and integrate it, so let me know if it makes sense now or not, and i cant see the logs when building with cmake, so i really dont know if its working or not (also i think android examples needs to be updated for gradle) |
looks good, will test it. you can pass -v option when running
Feel free to do it. |
…d gradle versions
- Upgraded Android Gradle plugin from version 8.1.0 to 8.10.0. - Updated Gradle wrapper distribution from version 8.5 to 8.11.1.
…pt to get module configurations
I just got some time and tested it, finding that your current implementation is okay but not elegant enough, e.g., cmake can't get user's project directory and flutter doesn't provide a concrete way to get it, and it will be better if the generation step doesn't produce any files. Therefore, I have made some changes for The current implementation works on android but need to be tested on linux and windows, you can try to do it if you have some time, if not I will do it, maybe in the next week if I have some free time, too busy recently :( |
Thank you for letting me know the changes, yeah I thought about dealing with the paths and file generated will be annoying and as you mentioned before maybe someone will inject commands into it This is why I went with the string approach, and I don't have Linux nor windows machines so I can't test it sadly 🥹 Also thank you and take your time I don't want the feature currently but I liked the addition and thought it will be great for users experience |
I have edited the PR to add a todo list, hope you won't mind it. Also, if the optional modules supported, I am considering whether it's necessary to keep the package |
Aha, it's okay, I will test it sometime. |
should fix #313, didnt try it yet though, but the yaml option was annyoing to implement and found out this option will make it easier to use, if it looks good on your side we can add an example to test it i guess
This pull request introduces a new feature to allow customization of OpenCV modules in the
opencv_dart
andopencv_core
packages. It adds support for a user-defined configuration file (opencv_config.cmake
) to enable or disable specific OpenCV modules during the build process. The changes include updates to documentation and build scripts to support this feature.Edit by rainyl:
TODO: