Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
niw committed Aug 31, 2010
1 parent 26a070a commit b4a7e9d
Showing 1 changed file with 36 additions and 25 deletions.
61 changes: 36 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,58 @@ Building Static Link Version of OpenCV
--------------------------------------
If you want to build it from source code, you can do by next steps.

1. Clone this project from github.com, then move into the project directory
1. Building OpenCV 2.1 requiers [CMake](http://www.cmake.org/).
You can easily install it by using [MacPorts](http://www.macports.org/).

% sudo port install cmake

2. Clone this project from github.com, then move into the project directory

% git clone git://github.com/niw/iphone_opencv_test.git

2. Getting source code from sourceforge. I tested with [OpenCV-2.0.0.tar.bz2](http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.0/OpenCV-2.0.0.tar.bz2/download).
3. Getting source code from sourceforge. I tested with [OpenCV-2.1.0.tar.bz2](http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.1/OpenCV-2.1.0.tar.bz2/download).

3. Extract downloaded archive on the top of project project directory

% tar xjvf opencv-2.0.0.tar.bz2
4. Extract downloaded archive on the top of demo project directory

4. Apply patch for iPhone SDK
% tar xjvf OpenCV-2.1.0.tar.bz2

% cd OpenCV-2.0.0
% patch -p0 < ../cvcalibration.cpp.patch_opencv-2.0.0
5. Apply patch for iPhone SDK

5. Following next steps to build OpenCV static library for simulator
% cd OpenCV-2.1.0
% patch -p1 < ../OpenCV-2.1.0.patch

% cd OpenCV-2.0.0
% mkdir build_simulator
% ../../configure_opencv
% make
% make install # Install all files into ../../opencv_simulator
6. Following next steps to build OpenCV static library for simulator.
All files are installed into ``opencv_simulator`` directory.
When running ``make`` command, you've better assign ``-j`` option and number according to number of your CPU cores.
Without ``-j`` option, it takes a long time.

6. Following next steps to build OpenCV static library for device
% cd ..
% mkdir build_simulator
% cd build_simulator
% ../opencv_cmake.sh Simulator ../OpenCV-2.1.0
% make -j 4
% make install

% cd OpenCV-2.0.0
% mkdir build_device
% ARCH=device ../../configure_opencv
% make
% make install # Install all files into ../../opencv_device
7. Following next steps to build OpenCV static library for device
All files are installed into ``opencv_device`` directory.

Patch and Configure support script
----------------------------------
% cd ..
% mkdir build_device
% cd build_device
% ../opencv_cmake.sh Device ../OpenCV-2.1.0
% make -j 4
% make install

OpenCV 2.0.0 (and also 1.1.0) has a glitch which refuse builing the library with iPhone SDK.
You need to apply the patch ``cvcalibration.cpp.patch`` so that you can build it.
Build support script
--------------------

Congiure support script ``configure_opencv`` has some options to build OpenCV with iPhone SDK.
Try to ``--help`` option to get the all options of it.
uild support script ``opencv_cmake.sh`` has some options to build OpenCV with iOS SDK.
Try ``--help`` option to get the all options of it.

Change Log
----------
* 08/22/2010 - Support OpenCV 2.1.0 + iOS SDK 4.x
* 12/21/2009 - Support Snow Leopard + iPhone SDK 3.1.2, Thank you Hyon!
* 11/15/2009 - Support OpenCV to 2.0.0 + iPhone SDK 3.x
* 03/14/2009 - Release this project with OpenCV 1.0.0 + iPhone SDK 2.x

0 comments on commit b4a7e9d

Please sign in to comment.