2011-08-23 19:19:58 +08:00
.. _iOS-Installation:
Installation in iOS
***** ***** ***** ***** ***
Required packages
==================
* GCC 4.x or later
2011-09-01 02:42:44 +08:00
* CMake 2.8 or higher
2011-08-23 19:19:58 +08:00
* Xcode 4.0 or higher
Getting the cutting-edge OpenCV from SourceForge SVN repository
-----------------------------------------------------------------
Launch SVN client and checkout either
2012-03-11 22:35:46 +08:00
a. the current OpenCV snapshot from here: http://code.opencv.org/svn/opencv/trunk
2011-08-23 19:19:58 +08:00
2012-03-11 22:35:46 +08:00
#. or the latest tested OpenCV snapshot from here: http://code.opencv.org/svn/opencv/tags/latest_tested_snapshot
2011-08-23 19:19:58 +08:00
In MacOS it can be done using the following command in Terminal:
.. code-block :: bash
cd ~/<my_working _directory>
2012-03-11 22:35:46 +08:00
svn co http://code.opencv.org/svn/opencv/trunk
2011-08-23 19:19:58 +08:00
Building OpenCV from source using CMake, using the command line
================================================================
#. Create a temporary directory, which we denote as <cmake_binary_dir>, where you want to put the generated Makefiles, project files as well the object filees and output binaries
#. Enter the <cmake_binary_dir> and type
.. code-block :: bash
cmake [<some optional parameters> ] <path to the OpenCV source directory>
For example
.. code-block :: bash
cd ~/opencv
cd ..
mkdir release
cd release
cmake -GXcode -DCMAKE_TOOLCHAIN_FILE=../opencv/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake -DCMAKE_INSTALL_PREFIX=../OpenCV_iPhoneOS -DCMAKE_BUILD_TYPE=RELEASE ../opencv
#. Enter the created temporary directory (<cmake_binary_dir>) and proceed with:
.. code-block :: bash
xcodebuild -sdk iphoneos -configuration Release -target ALL_BUILD
xcodebuild -sdk iphoneos -configuration Release -target install install