1. download latest opencv package from http://opencv.org/
$ wget https://github.com/Itseez/opencv/archive/3.0.0.zip
2. unzip the package
$ unzip opencv-3.0.0.zip
3. install xcode and macport
a. http://guide.macports.org/#installing.xcode
b. https://www.macports.org/install.php
4. install cmake
$ sudo port install cmake
5. build and install
$ mkdir build
$ cd build
$ cmake -G "Unix Makefiles" ..
$ make -j8
$ sudo make install
6. open xcode, create a new project named "helloCV", and set path
a. select [project], select [Build Settings], select [library search paths], add below setting
/usr/local/libb. select [project], select [Build Settings], select [header search paths], add below setting
/usr/local/includec. select [Targets], select [Build Phases], select [Link Binnary With Libraries], press [Add]
/usr/local/include/opencv
add all files in /usr/local/lib
7. modify default main.cpp to show a image
The source code can be get from https://github.com/alb423/opencv_practice
Reference: