Commit Graph

32 Commits

Author SHA1 Message Date
Alexander Smorkalov
bbda6f4c57 Backport 5.x: Support for module names that start from digit in ObjC bindings generator. 2023-05-25 11:45:59 +03:00
Giles Payne
a44a6f6c87 Fix issue in Objective-C generator when a class name is a substring of its base class name 2023-05-10 15:34:25 +09:00
Giles Payne
cfa5a270d3 Refactor Mat Converters and Mat QuickLook functionality to avoid "unrecognized selector" error 2023-04-18 21:09:55 +09:00
Alexander Alekhin
b5400902a7
Merge pull request #23002 from alalek:issue_22206
* obj-c: de-duplicate values of nested enums

- prefix with outer class name

* obj-c: handle enum names change in assigned values

* obj-c: switch on 'const_fix'

* obj-c: add NS_SWIFT_NAME
2022-12-22 14:01:21 +00:00
Giles Payne
9ce0e51305 Objective-C wrapper header fix-ups to avoid clashes with system macros 2022-03-20 18:47:26 +09:00
Andrey Senyaev
4d3cf77ad5 Replaced distutils to shutil when copying files in a tree 2021-12-10 11:46:27 +03:00
Alexander Alekhin
81f0b0e0dc cmake: fix tracking detail headers 2021-04-01 12:21:18 +00:00
Giles Payne
29b453eb86 Objective-C name clash avoidance 2020-12-01 11:22:57 -08:00
Jonathan Cole
85b0fb2a9c
Merge pull request #18826 from Rightpoint:feature/colejd/build-catalyst-xcframework
Support XCFramework builds, Catalyst

* Early work on xcframework support

* Improve legibility

* Somehow this works

* Specify ABIs in a place where they won't get erased

If you pass in the C/CXX flags from the Python script, they won't be respected. By doing it in the actual toolchain, the options are respected and Catalyst successfully links.

* Clean up and push updates

* Actually use Catalyst ABI

Needed to specify EXE linker flags to get compiler tests to link to the Catalyst ABIs.

* Clean up

* Revert changes to common toolchain that don't matter

* Try some things

* Support Catalyst build in OSX scripts

* Remove unnecessary iOS reference to AssetsLibrary framework

* Getting closer

* Try some things, port to Python 3

* Some additional fixes

* Point Cmake Plist gen to osx directory for Catalyst targets

* Remove dynamic lib references for Catalyst, copy iOS instead of macos

* Add flag for building only specified archs, remove iOS catalyst refs

* Add build-xcframework.sh

* Update build-xcframework.sh

* Add presumptive Apple Silicon support

* Add arm64 iphonesimulator target

* Fix xcframework build

* Working on arm64 iOS simulator

* Support 2.7 (replace run with check_output)

* Correctly check output of uname_m against arch

* Clean up

* Use lipo for intermediate frameworks, add python script

Remove unneeded __init__.py

* Simplify python xcframework build script

* Add --only-64-bit flag

* Add --framework-name flag

* Document

* Commit to f-strings, improve console output

* Add i386 to iphonesimulator platform in xcframework generator

* Enable objc for non-Catalyst frameworks

* Fix xcframework builder for paths with spaces

* Use arch when specifying Catalyst build platform in build command

* Fix incorrect settings for framework_name argparse configuration

* Prefer underscores instead of hyphens in new flags

* Move Catalyst flags to where they'll actually get used

* Use --without=objc on Catalyst target for now

* Remove get_or_create_folder and simplify logic

* Remove unused import

* Tighten up help text

* Document

* Move common functions into cv_build_utils

* Improve documentation

* Remove old build script

* Add readme

* Check for required CMake and Xcode versions

* Clean up TODOs and re-enable `copy_samples()`

Remove TODO

Fixup

* Add missing print_function import

* Clarify CMake dependency documentation

* Revert python2 change in gen_objc

* Remove unnecessary builtins imports

* Remove trailing whitespace

* Avoid building Catalyst unless specified

This makes Catalyst support a non-breaking change, though defaults should be specified when a breaking change is possible.

* Prevent lipoing for the same archs on different platforms before build

* Rename build-xcframework.py to build_xcframework.py

* Check for duplicate archs more carefully

* Prevent sample copying error when directory already exists

This can happen when building multiple architectures for the same platform.

* Simplify code for checking for default archs

* Improve build_xcframework.py header text

* Correctly resolve Python script paths

* Parse only known args in ios/osx build_framework.py

* Pass through uncaptured args in build_xcframework to osx/ios build

* Fix typo

* Fix typo

* Fix unparameterized build path for intermediate frameworks

* Fix dyanmic info.plist path for catalyst

* Fix utf-8 Python 3 issue

* Add dynamic flag to osx script

* Rename platform to platforms, remove armv7s and i386

* Fix creation of dynamic framework on maccatalyst and macos

* Update platforms/apple/readme.md

* Add `macos_archs` flag and deprecate `archs` flag

* Allow specification of archs when generating xcframework from terminal

* Change xcframework platform argument names to match archs flag names

* Remove platforms as a concept and shadow archs flags from ios/osx .py

* Improve documentation

* Fix building of objc module on Catalyst, excluding Swift

* Clean up build folder logic a bit

* Fix framework_name flag

* Drop passthrough_args, use unknown_args instead

* minor: coding style changes

Co-authored-by: Chris Ballinger <cballinger@rightpoint.com>
2020-11-24 21:54:54 +00:00
Alexander Alekhin
eafe6ccdbe objc: fix handling of std::vector<std::vector<T>> return type 2020-11-23 19:16:23 +00:00
Alexander Alekhin
4c9e3723e8 objc: skip unsupported inner namespaces 2020-11-16 19:52:16 +00:00
Alexander Alekhin
14aa8affe5 Merge pull request #18811 from alalek:objc_headers_import 2020-11-16 09:52:26 +00:00
Alexander Alekhin
3da1e8b2f8 Merge pull request #18805 from alalek:cmake_objc_generator 2020-11-16 08:44:14 +00:00
Alexander Alekhin
786cecfe66 Merge pull request #18817 from alalek:fixup_objc_tests 2020-11-16 07:58:48 +00:00
Alexander Alekhin
24f2b7dd3f objc(test): repair binary resource files 2020-11-16 05:22:45 +00:00
Alexander Alekhin
cfbdbffcad objc: rework headers import
- 'AdditionalImports' can be removed from misc/objc/gen_dict.json
- avoid using of legacy 'opencv.hpp'
2020-11-15 05:24:01 +00:00
Alexander Alekhin
90bea15e35 objc: robust code generation
- the same generated code from Python2/3
- avoid randomized output due to unpredictable dict/set order
2020-11-14 22:31:47 +00:00
Alexander Alekhin
9e84b860f2 cmake: update objc generator scripts
- allow to run generator without strong requirement of building 'objc' module
2020-11-14 20:59:55 +00:00
Chris Ballinger
4d00ed8df7
Merge pull request #18771 from chrisballinger:xcode-12-fixes
Xcode 12 and Python 2/3 fixes

* Fix compilation issues using Xcode 12 on macOS Catalina

* Fix macOS scripts to work on Python 2 or 3

* Fix additional issues with Python 3

* Fix additional Python 2/3 issue

* Fix another Python 2/3 issue

* Remove dependency on builtins module
2020-11-13 15:30:53 +00:00
Giles Payne
72dfd4846e
Merge pull request #18637 from komakai:build-for-distribution
Add support for Swift version independence

* Build for distribution (Swift version independence) when new Xcode build system is available

* Add module map and set "Defines Modules" flag
2020-10-23 11:19:36 +00:00
Alexander Alekhin
9c8626bf3c Merge pull request #18605 from komakai:fix-swift-binding 2020-10-17 16:57:04 +00:00
Giles Payne
ef21fd3cf8 Fix handling of properties with enum type 2020-10-17 14:31:24 +09:00
mtfrctl
7de189114b
Merge pull request #18547 from mtfrctl:objc-conversions-macosx
Mat conversions for macOS/AppKit

* Extract CoreGraphics conversion logics from ios_conversions.mm to apple_conversions.h, apple_conversions. Add macosx_conversions.mm

* Add macosx.h

* Add Mat+Conversions.h and Mat+Conversions.mm

* Delete duplicated declaration from apple_conversion.mm

* Use short license header

* Add compile guard

* Delete unused imports

* Move precomp.hpp import from header to implementation

* Add macosx.h to skip headers

* Fix compile guard condition

* Use short license header

* Remove commented out unused code
2020-10-14 16:58:06 +00:00
Giles Payne
80d4d4d92c Update tests and samples to work with changes to dynamic build 2020-09-27 21:12:28 +09:00
Giles Payne
098f07664d Fix support for --without build flag on iOS/macOS build 2020-09-27 21:12:18 +09:00
Giles Payne
8b61719a9d Swift native in/out array handling 2020-09-03 21:31:11 +09:00
Giles Payne
bedabc15ae Obj-C/Swift docs improvements 2020-08-09 16:53:10 +09:00
Giles Payne
4cf76754d3 Add Objective-C/Swift wrappers for opencv_contrib modules 2020-07-21 19:19:08 +09:00
Giles Payne
af9ee90091
Merge pull request #17818 from komakai:documentation-improvements
Documentation fixes/improvements

* Documentation fixes/improvements

* Remove HASH_UTILS defines
2020-07-15 18:42:05 +00:00
Giles Payne
59ba33658a Dynamic build for Objective-C/Swift wrapper 2020-06-26 08:26:05 +09:00
Giles Payne
13962b8533 Use cv::Ptr instead of raw pointers 2020-06-15 23:20:45 +09:00
Giles Payne
02385472b6
Merge pull request #17165 from komakai:objc-binding
Objc binding

* Initial work on Objective-C wrapper

* Objective-C generator script; update manually generated wrappers

* Add Mat tests

* Core Tests

* Imgproc wrapper generation and tests

* Fixes for Imgcodecs wrapper

* Miscellaneous fixes. Swift build support

* Objective-C wrapper build/install

* Add Swift wrappers for videoio/objdetect/feature2d

* Framework build;iOS support

* Fix toArray functions;Use enum types whenever possible

* Use enum types where possible;prepare test build

* Update test

* Add test runner scripts for iOS and macOS

* Add test scripts and samples

* Build fixes

* Fix build (cmake 3.17.x compatibility)

* Fix warnings

* Fix enum name conflicting handling

* Add support for document generation with Jazzy

* Swift/Native fast accessor functions

* Add Objective-C wrapper for calib3d, dnn, ml, photo and video modules

* Remove IntOut/FloatOut/DoubleOut classes

* Fix iOS default test platform value

* Fix samples

* Revert default framework name to opencv2

* Add converter util functions

* Fix failing test

* Fix whitespace

* Add handling for deprecated methods;fix warnings;define __OPENCV_BUILD

* Suppress cmake warnings

* Reduce severity of "jazzy not found" log message

* Fix incorrect #include of compatibility header in ios.h

* Use explicit returns in subscript/get implementation

* Reduce minimum required cmake version to 3.15 for Objective-C/Swift binding
2020-06-08 18:32:53 +00:00