Hi, I am able to compile OpenCV by following below instructions,
- Prepare CMake. (e.g.
brew install cmake
) - Download
opencv-4.2.0.zip
from https://github.com/opencv/opencv/archive/4.2.0.zip. - Prepare a working directory. (e.g.
mkdir ~/foo
) - Unpack the file into the working directory.
- Open terminal at the working directory. (e.g.
cd ~/foo
) - Run a build script by python 2.
python opencv-4.2.0/platforms/osx/build_framework.py osx
- Copy
osx/opencv2.framework
intoOpenCVSample_macOS
directory.
It’s working great in my macOS project. But I have to archive the build for distribution. When I am going to archive I am getting the error,
The linked framework ‘opencv2.framework’ is missing one or more architectures required by this target: arm64.
Luckily I found a git repo for building OpenCV for osx. But I don’t have any idea to build the OpenCV for macOS along with M1 Chip support. Can you please anyone help me to solve this problem?
I asked question in Stack Overflow too: https://stackoverflow.com/questions/70541655/opencv-the-linked-framework-opencv2-framework-is-missing-one-or-more-architec
Thank you very much for your help.