opencv/cmake
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
..
android Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-12-15 11:23:46 +00:00
checks Added cmake toolchain for RISC-V with clang. 2020-08-03 20:18:56 +08:00
FindCUDA FIx misc. source and comment typos 2019-08-15 13:09:52 +03:00
platforms cmake: fix UWP scripts path 2019-10-16 21:42:31 +00:00
templates Merge pull request #18547 from mtfrctl:objc-conversions-macosx 2020-10-14 16:58:06 +00:00
cl2cpp.cmake cmake: don't add include <module>/src directory to avoid conflicts 2018-03-19 11:14:15 +03:00
copy_files.cmake cmake: fix android examples dependencies 2018-03-15 14:17:02 +03:00
FindCUDA.cmake Misc. typos 2018-07-31 18:44:23 +03:00
FindCUDNN.cmake Merge pull request #17499 from cyyever:fix_CUDA11 2020-06-27 20:34:44 +00:00
FindFlake8.cmake cmake: added check_flake8 target 2018-05-11 17:32:22 +03:00
FindONNX.cmake Added small cmake fix 2020-11-19 21:22:19 +03:00
FindOpenVX.cmake
FindPylint.cmake
FindVulkan.cmake Merge pull request #12703 from wzw-intel:vkcom 2018-10-29 17:51:26 +03:00
OpenCVCompilerDefenses.cmake Added support for Clang build hardening (including Apple) 2019-05-07 13:00:43 +03:00
OpenCVCompilerOptimizations.cmake Added cmake toolchain for RISC-V with clang. 2020-08-03 20:18:56 +08:00
OpenCVCompilerOptions.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-07-06 23:05:04 +00:00
OpenCVCRTLinkage.cmake cmake: update handling of MSVC /MP flag 2020-02-11 21:05:44 +00:00
OpenCVDetectApacheAnt.cmake FIx misc. source and comment typos 2019-08-15 13:09:52 +03:00
OpenCVDetectCUDA.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-10-11 17:19:22 +00:00
OpenCVDetectCXXCompiler.cmake Added initial version of cmake toolchain for RISC-V architecture. 2020-04-27 12:42:38 +03:00
OpenCVDetectDirectX.cmake Merge pull request #14294 from alalek:issue_14286 2019-04-11 17:50:15 +03:00
OpenCVDetectHalide.cmake
OpenCVDetectInferenceEngine.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-11-10 20:09:18 +00:00
OpenCVDetectOpenCL.cmake Fixed and updated OpenCL-VA interoperability 2020-09-25 16:11:50 +03:00
OpenCVDetectPython.cmake fix: minor typo in CMakeCVDetectPython 2020-03-21 11:15:07 +02:00
OpenCVDetectTBB.cmake Fix TBB debug 2019-05-27 10:26:06 +03:00
OpenCVDetectTrace.cmake
OpenCVDetectVTK.cmake don't use VTK_USE_FILE for VTK >= 8.90 2020-09-06 15:47:43 -04:00
OpenCVDetectVulkan.cmake Merge pull request #12703 from wzw-intel:vkcom 2018-10-29 17:51:26 +03:00
OpenCVDownload.cmake cmake: add directory creation to download helper scripts 2019-09-04 17:09:13 +03:00
OpenCVExtraTargets.cmake cmake: update generation of 'uninstall' target 2020-04-07 22:03:12 +00:00
OpenCVFindAtlas.cmake
OpenCVFindFrameworks.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-02 05:33:35 +00:00
OpenCVFindIPP.cmake ippicv: install third-party-programs.txt file 2020-09-25 22:09:25 +00:00
OpenCVFindIPPIW.cmake Merge pull request #16769 from mshabunin:fix-ipp-install 2020-04-17 14:28:42 +00:00
OpenCVFindLAPACK.cmake LAPACK: add support for complex numbers for MSVC 2019-05-22 18:43:45 +03:00
OpenCVFindLATEX.cmake
OpenCVFindLibsGrfmt.cmake 3rdparty: integrate OpenJPEG build to the OpenCV CMake 2020-09-02 20:45:35 +00:00
OpenCVFindLibsGUI.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-05-23 19:50:20 +03:00
OpenCVFindLibsPerf.cmake cmake: prefer using Eigen configuration files 2020-11-05 17:01:23 +00:00
OpenCVFindLibsVideo.cmake Fixed and updated OpenCL-VA interoperability 2020-09-25 16:11:50 +03:00
OpenCVFindMKL.cmake improve the mkl search procedure 2020-06-12 06:59:27 +00:00
OpenCVFindOpenBLAS.cmake Fix typo in OpenCVFindOpenBLAS.cmake file. 2020-11-08 14:42:47 +01:00
OpenCVFindOpenEXR.cmake Fix typo 2020-06-12 23:52:06 +02:00
OpenCVFindProtobuf.cmake cmake: fix protobuf handling 2020-04-27 02:11:19 +00:00
OpenCVFindTengine.cmake Merge pull request #16832 from liqi-c:3.4-tengine-android 2020-03-20 10:10:39 +00:00
OpenCVFindVA.cmake Fixed and updated OpenCL-VA interoperability 2020-09-25 16:11:50 +03:00
OpenCVFindWebP.cmake update CMakeList.txt 2018-02-05 16:23:52 +03:00
OpenCVFindXimea.cmake Merge pull request #13422 from mshabunin:split-videoio-cmake 2018-12-26 15:50:20 +03:00
OpenCVGenABI.cmake cmake: support OPENCV_ABI_SKIP_MODULES_LIST 2020-01-27 14:40:48 +03:00
OpenCVGenAndroidMK.cmake next(android): java3 -> java4 2018-04-10 18:09:54 +03:00
OpenCVGenConfig.cmake Merge pull request #17165 from komakai:objc-binding 2020-06-08 18:32:53 +00:00
OpenCVGenHeaders.cmake
OpenCVGenInfoPlist.cmake Merge pull request #18826 from Rightpoint:feature/colejd/build-catalyst-xcframework 2020-11-24 21:54:54 +00:00
OpenCVGenPkgconfig.cmake cmake: update install paths (Linux) 2018-09-19 15:43:52 +03:00
OpenCVGenSetupVars.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-12-18 19:07:43 +00:00
OpenCVInstallLayout.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-09-20 21:11:49 +00:00
OpenCVMinDepVersions.cmake Merge pull request #14827 from YashasSamaga:cuda4dnn-csl-low 2019-10-21 14:28:00 +03:00
OpenCVModule.cmake Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2020-09-19 17:03:08 +00:00
OpenCVPackaging.cmake Merge pull request #18073 from vpisarev:apache2_license 2020-08-17 11:49:11 +00:00
OpenCVPCHSupport.cmake Fix pch generation when linker flags used with GCC 2019-12-10 14:55:56 +00:00
OpenCVPylint.cmake cmake: fix Ninja generator warning about pylintrc 2018-04-10 12:23:10 +03:00
OpenCVUtils.cmake Merge pull request #18826 from Rightpoint:feature/colejd/build-catalyst-xcframework 2020-11-24 21:54:54 +00:00
OpenCVVersion.cmake cmake: hide 'junk' dir from the root of build directory 2018-12-07 05:14:08 +00:00