1/27, 2014現在のgitリポジトリからダウンロードした
OpenCV はiOS向けにはそのままだとビルドできません。
そのための修正をメモ
ソース修正
対象ファイルの指定行を追加修正
3rdParty/libjpeg/CMakeLists.txt:12, jmemansi.c をビルドから除く(これはすでに適応済み?)
if(ANDROID OR IOS)
ocv_list_filterout(lib_srcs jmemansi.c)
else()
ocv_list_filterout(lib_srcs jmemnobs.c)
endif()
modules/world/CMakeLists.txt:105 追加
ocv_list_filterout(objlist jmemansi) # <<= dirty fix
arm64対応
https://stackoverflow.com/questions/18976893/how-to-compile-opencv-for-ios7-arm64
arm64ビルドは諦めて、armv7, armv7sのみのビルドに変更する
のincludeに追加opencv/3rdparty/zlib/ にあるgzlib.c, gzread.c, gzwrite.c#include<unistd.h>
opencv/platforms/ios/build_framework.py 行99、100: 変更targets = ["iPhoneOS", "iPhoneOS", ""iPhoneSimulator", "iPhoneSimulator"] archs = ["armv7", "armv7s", "i386", "x86_64"]arm64を削除しますなくても、iPhone5sでも動く(プロジェクトがarmv7,armv7sでビルドされる場合)ので取りあえずなしでビルド
ビルドする
ビルド環境のパスを通すsudo ln -s /Applications/Xcode.app/Contents/Developer /Developer
cmakeない場合は、portからinstall
sudo port install cmake
ビルド
python platforms/ios/build_framework.py ios
※モバイル系の記事は人気あるなあ
0 件のコメント:
コメントを投稿