For iOS I’m trying to build an earlier version of opencv with contrib (4.2 to be exact) using this command:
python3 opencv/platforms/ios/build_framework.py ./contrib_output --without objc --contrib opencv_contrib --iphoneos_archs arm64 --iphonesimulator_archs x86_64
But I’m getting this error:
Using IPHONEOS_DEPLOYMENT_TARGET=8.0
Using iPhoneOS ARCHS=['arm64']
Using iPhoneSimulator ARCHS=['x86_64']
============================================================
ERROR: cannot use a string pattern on a bytes-like object
============================================================
Traceback (most recent call last):
File "/Users/xyz/Documents/openCV/opencv/platforms/ios/build_framework.py", line 120, in build
self._build(outdir)
File "/Users/xyz/Documents/openCV/opencv/platforms/ios/build_framework.py", line 88, in _build
xcode_ver = getXCodeMajor()
^^^^^^^^^^^^^^^
File "/Users/xyz/Documents/openCV/opencv/platforms/ios/build_framework.py", line 45, in getXCodeMajor
m = re.match(r'Xcode\s+(\d+)\..*', ret, flags=re.IGNORECASE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/re/__init__.py", line 167, in match
return _compile(pattern, flags).match(string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: cannot use a string pattern on a bytes-like object
if you want to get around that error, you could edit the source of build_framework.py and insert something along the lines of ret.decode('utf-8') in the re.match call
– Check size of unsigned long
CMake Error at /opt/homebrew/lib/python3.11/site-packages/cmake/data/share/cmake-3.27/Modules/CheckTypeSize.cmake:146 (try_compile):
Cannot copy output executable