将以下脚本保存为shell脚本并运行: sh build-protobuf-2.6.1.sh build-protobuf-2.6.1.sh #!/bin/bash -x echo "$(tput setaf 2)" echo Building Google Protobuf for Mac OS X / iOS. echo Use 'tail -f build.log' to monitor progress. echo "$(tput sgr0)" # Controls which architectures are build/included in the # universal binaries and libraries this script produces. # Set each to '1' to include, '0' to exclude. BUILD_X86_64_MAC=1 BUILD_X86_64_IOS_SIM=1 BUILD_I386_IOS_SIM=1 BUILD_ARMV7_IPHONE=1 BUILD_ARMV7S_IPHONE=1 BUILD_ARM64_IPHONE=1 PB_VERSION=2.6.1 # Set this to the replacement name for the 'google' namespace.

Continue reading

转载自:https://github.com/Tencent/ncnn/wiki/cmake-%E6%89%93%E5%8C%85-ios-sdk 安装 xcode 和 cmake xcode https://developer.apple.com/xcode/download cmake OS X版本 https://cmake.org/download 默认情况 cmake 命令行可能用不了,需要手工加在 PATH 里面 export PATH=/Applications/CMake.app/Contents/bin/:$PATH 准备 ios toolchain 文件 把 ios.toolchain.cmake 放到和 CMakeLists.txt 同一级的项目目录里 可以去 opencv 的 github 上弄来,自己稍微调整下。 传送门 https://github.com/Itseez/opencv/tree/master/platforms/ios/cmake 编译方法 mkdir build-ios cd build-ios cmake -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE=../ios.toolchain.cmake \ -DIOS_PLATFORM=iPhoneOS \ -DCMAKE_OSX_ARCHITECTURES=armv7 .. make make install make package 没有遇到错误的话,手机平台 armv7 库已经编好了 这里简要介绍几个参数 IOS_PLATFORM 是平台名字,iPhoneOS 是真实机器的 ios,iPhoneSimulator 是模拟器平台 CMAKE_OSX_ARCHITECTURES 指定架构,iPhoneOS 配套 armv7 armv7s arm64,iPhoneSimulator 配套 i386 x86_64 CMakeLists.

Continue reading

Author's picture

Neil Wang

久长唯有品格

To Be Marvelous

Yichang·Hubei