If you are here just to cross-compile OpenCV, follow these simple instructions. The older post is a little more detailed, error-prone, pedantic, and maybe out of date.
If you want to cross-compile OpenCV from source code, you can do by next steps.
- Building OpenCV 2.1 requiers CMake. You can easily install it by using MacPorts, or follow the installation instructions at the CMake website.
% sudo port install cmake - Clone this project from github, then move into the project directory
% git clone git://github.com/gonzojive/iphone_opencv_test.git % cd iphone_opencv_test - Download the source code for OpenCV from Sourceforge. Save OpenCV-2.1.0.tar.bz2 into the project root.
- Use the provided Makefile:
% make
This will extract the downloaded archive, apply a patch to the OpenCV code, generate appropriate cmakefile suport using the opencv_cmake.sh script, and finally make the static libraries for simulator and device. The libraries will be in the opencv_{device,simulator} directories, and may be linked in XCode etc.

