I'm writing an iOS application that runs an xml-rpc server. I'm using the C library for xml-rpc available here : http://xmlrpc-c.sourceforge.net/ . The library uses ./configure to generate the makefile according to the host architecture, and make, make install to build/install the library.
I need to use this library with my iOS application. I understand that XCode uses a completely different build system, and I'm new to iOS development, so I'm not quite sure how to tie in the library with my application. What options do I need to pass in with ./configure to compile the library for iOS architectures (I understand there are three targets, armv7, armv7s and i386)?
Thanks in advance.
Here are the configure script options for the simulator and device platforms.
Simulator (i386) :
$ ./configure --host=i386-apple-darwin --prefix <path_to_binaries> CFLAGS="-arch i386 -isysroot /Applications/XCode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/ -miphoneos-version-min=4.0 --disable-cplusplus
$ make
$ make install
iOS device (arm) : this is a bit trickier, and there's an unresolved issue with this, but here are the general steps:
$ ./configure --host=arm-apple-darwin --prefix <path_to_binaries> CFLAGS="-arch armv7s -isysroot /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -miphoneos-version-min=4.0" --disable-curl-client --disable-cplusplus LDFLAGS='-arch armv7s -miphoneos-version-min=4.0 -isysroot /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk’
$ make
Notes specific to this library : We need to build gennmtab against x86, since it defines the symbol table and is to be run on the machine compiling the program - run the following commands (starting from the base xmlrpc-xx.xxx directory)
$ cd lib/expat/gennmtab/
$ rm gennmtab gennmtab.o
$ gcc -c gennmtab.c -o gennmtab.o -DNDEBUG -Wall -W -Wno-uninitialized -Wundef -Wimplicit -Winline -Wno-unknown-pragmas -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -fno-common -g -O3 -D_THREAD -I/Users/sradhakrishnan/dev/xmlrpc-c-1.25.28 -Isrcdir/lib/util/include -I/Users/sradhakrishnan/dev/xmlrpc-c-1.25.28 -Isrcdir/lib/util/include
Now that gennmtab has been built against x86, continue with previous make, by running the following:
$ cd ../../../ (you are back in the base xmlrpc-xx.xxx directory)
$ make
$ make install
Related
I'm trying to build a static cryptopp library for ios. I'm basing my steps from these sites:
http://cryptopp.com/wiki/IOS_(Command_Line)#Xcode_Project
https://github.com/noloader/cryptopp-5.6.2-ios
https://www.cryptopp.com/
1.) I downloaded the latest cryptopp version 5.6.3
2.) I downloaded noloader's cryptopp-5.6.2-ios becasue it has updated:
setenv-ios.sh - i had to edit this to search for sdk 9.2
GNUmakefile
config.h
build-for-ios.sh
3.) I copied the four files to my cryptopp 5.6.3 directory and replaced GNUmakefile and config.h
4.) I checked out IOS_Command_Line instruction to invoke setenv-ios.sh first.
5.) Then, as noloader said, run build-for-ios.sh.
However, i'm getting this error:
Has anyone successfully built the library using the latest ios SDK and cryptopp version? If so, can you please point me to the right direction. Thanks.
The documentation was not correct under IOS (Command Line) | Build the Library. After setting the environment with setenv-ios.sh, you should use GNUmakefile-cross:
$ make -f GNUmakefile-cross static dynamic cryptest.exe
clang++ -DNDEBUG -g2 -Os -fPIC -pipe -Wall -Wno-delete-non-virtual-dtor -arch armv7 -isysroot
/Applications/Xcode-5_1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
-stdlib=libc++ -c cryptlib.cpp
clang++ -DNDEBUG -g2 -Os -fPIC -pipe -Wall -Wno-delete-non-virtual-dtor -arch armv7 -isysroot
/Applications/Xcode-5_1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
-stdlib=libc++ -c cpu.cpp
clang++ -DNDEBUG -g2 -Os -fPIC -pipe -Wall -Wno-delete-non-virtual-dtor -arch armv7 -isysroot
/Applications/Xcode-5_1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
-stdlib=libc++ -c 3way.cpp
...
I thought we updated the iOS procedures when we updated the Android procedures. I'm not sure what went wrong the documentation updates.
We checked in the scripts for setenv-ios.sh, setenv-android.sh and setenv-embedded.sh in March 2016. GNUmakefile-cross was already in the library. Also see Commit a78b9dfa0840f92f, Added iOS environment and test script and Commit 22d6374ce7151ad0, Added Android and embedded environment and test script.
All you should need to do now is the following:
git clone https://github.com/weidai11/cryptopp.git
cd cryptopp
. ./setenv-ios.sh
make -f GNUmakefile-cross static dynamic cryptest.exe
...
The new/updated files will be available in the ZIP at the next Crypto++ release, which will be either 5.6.4 or 5.7.0.
I've been trying to build webrtc for iOS following Google's directions at http://www.webrtc.org/native-code/ios (and related links). Although I recall that with similar steps I've been able to build it in the past this is no longer the case.
Here's the steps I did:
Download prerequisites:
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
$ export PATH=`pwd`/depot_tools:"$PATH"
Download repo:
$ export GYP_DEFINES="OS=ios"
$ fetch webrtc_ios
Prepare build:
$ cd webrtc/src
$ export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_objc=1"
$ export GYP_DEFINES="$GYP_DEFINES OS=ios target_arch=armv7"
$ export GYP_GENERATOR_FLAGS="output_dir=out_ios"
$ export GYP_CROSSCOMPILE=1
$ gclient runhooks
Build:
$ ninja -C out_ios/Debug-iphoneos AppRTCDemo
Everything is ok, until the last command that fails with /bin/sh: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc: No such file or directory:
ninja: Entering directory `out_ios/Debug-iphoneos'
[3/1664] CC obj/chromium/src/third_party/boringssl/src/crypto/bio/boringssl.bio_mem.o
FAILED: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -MMD -MF obj/chromium/src/third_party/boringssl/src/crypto/bio/boringssl.bio_mem.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -DDISABLE_NACL -DCHROMIUM_BUILD -DCR_CLANG_REVISION=247874-1 -DUSE_LIBJPEG_TURBO=1 -DENABLE_CONFIGURATION_POLICY -DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE -DDONT_EMBED_BUILD_METADATA -DFIELDTRIAL_TESTING_ENABLED -DDISABLE_FTP_SUPPORT=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DBORINGSSL_IMPLEMENTATION -DBORINGSSL_NO_STATIC_INITIALIZER -DOPENSSL_NO_ASM -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -Igen -I../../chromium/src/third_party/boringssl/src/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -O0 -gdwarf-2 -fvisibility=hidden -Wnewline-eof -miphoneos-version-min=7.0 -arch arm64 -Wendif-labels -Wno-unused-parameter -Wno-missing-field-initializers -Wno-selector-type-mismatch -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-bitfield-width -Wno-unused-function -Wno-unused-variable -m32 -arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/usr/include/ -m32 -arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/usr/include/ -std=c99 -Xclang -load -Xclang /Volumes/store/code/webrtc/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -fcolor-diagnostics -fstack-protector-all -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -c ../../chromium/src/third_party/boringssl/src/crypto/bio/bio_mem.c -o obj/chromium/src/third_party/boringssl/src/crypto/bio/boringssl.bio_mem.o
/bin/sh: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc: No such file or directory
For some reason ninja thinks we are building for the Simulator, plus even if we did this would not be the right path to get gcc. Notice that my system has XCode 7 installed.
Any ideas what might be wrong or how I could work around this?
Best regards,
Antonis
A year ago I also wanted to build library using Google's instructions but I was unable to. Many errors occurred and I ended up googling for some build script. In the end I found this script. Make following steps and you will build it successfully:
Install Command Line Tools but pasting this command in terminal: xcode-select --install
Clone script: git clone https://github.com/lunastorm/webrtc-ios.git
Enter git repository in Terminal and run script with following command: make -j4 where j4 marks number of CPU cores (correct me if I'm wrong). This can take a while so prepare your self a cup of coffee
Build will fail for the first time but don't worry, just delete the folders which script downloaded. I will write which ones in edit
Find your code signing identity which is valid for building iOS apps. Type security find-identity in terminal. Pick one under Valid identities only
Open the global configuration file src/build/common.gypi and search for the text ‘CODE_SIGN_IDENTITY’. Replace ‘CODE_SIGN_IDENTITY[sdk=iphoneos*]‘: ‘iPhone Developer’ with your developer information i.e. ‘CODE_SIGN_IDENTITY[sdk=iphoneos*]‘: ‘iPhone Developer: Josip Bernat (2V3DKW6SDC)’
Run the script again using make -j4 and hopefully it will build you WebRTC.framework
How can I install latest ffmpeg ios libraries armv7, armv7s, i386 and universal on Mac with 10.8?
After a couple of days I have made step by step instructions for this install:
FFmpeg Build Instructions MAC 10.8 or better
Copy ffmpeg-2.0.tar.bz2 (https://ffmpeg.org/releases/ffmpeg-1.0.7.tar.bz2, https://ffmpeg.org/download.html) and Unzip to Documents folder
Make sure you have the latest Command Line Tools under Xcode >; Preferences >; Downloads >; Components
Install gas-preprocessor
Click on the ZIP icon to download https://github.com/mansr/gas-preprocessor.
Copy gas-preprocessor.pl to /usr/bin directory.
Change permission of gas-preprocessor.pl by setting the privilege to Read & Write for all.
Bug in xcrun starting in version 10.8
open terminal and paste in following command and press enter:
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"
cd to ffmpeg-2 folder and paste in following command and press enter:
mkdir armv7
mkdir armv7s
mkdir i386
mkdir -p universal/lib
To config armv7s library paste in following command and press enter:
./configure --prefix=armv7s --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" --extra-cflags="-arch armv7s -mfpu=neon -miphoneos-version-min=6.1" --extra-ldflags="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.1" --arch=arm --cpu=cortex-a9 --enable-pic
(Note same rule as above: if config fails go to
Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
and make sure that the sdk folder is iPhoneOS6.1.sdk, if not change
the config command to reflect iPhoneOSx.x.sdk and change all targets
to x.x)
To build and install armv7s library paste in following command and press enter:
make clean && make && make install
To config i386 (so simulator will work ) library paste in following command and press enter:
./configure --prefix=i386 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" --extra-cflags="-arch i386" --extra-ldflags="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --arch=i386 --cpu=i386 --enable-pic --disable-asm
(Note: this is not the same command as the previous two config
commands, if you just arrow up to them this will fail)
To build and install i386 library paste in following command and press enter:
make clean && make && make install
To make universal library ( which is the library added to xcode ) paste in following command and press enter:
cd armv7/lib
for file in *.a
do
cd ../..
xcrun -sdk iphoneos lipo -output universal/lib/$file -create -arch armv7 armv7/lib/$file -arch armv7s armv7s/lib/$file -arch i386 i386/lib/$file
echo "Universal $file created."
cd -
done
cd ../..
Support universal ffmpeg library for iOS7 and XCode5:
Make sure you have the latest Command Line Tools under Xcode >; Preferences >; Downloads >; Components
Install gas-preprocessor
Click on the ZIP icon to download https://github.com/mansr/gas-preprocessor.
Copy gas-preprocessor.pl to /usr/bin directory.
Change permission of gas-preprocessor.pl by setting the privilege to Read & Write for all.
Download my shell script from: https://gist.github.com/m1entus/6983547
Run sh build-ffmpeg.sh.
I needed arm64 support and this script worked for me: https://github.com/kewlbear/FFmpeg-iOS-build-script
Use
./build-ffmpeg.sh arm64 x86_64
for iOS 64-bit and simulator architecture. Then copy the contents in the "fat" directory into your Xcode project.
The only modification I made to the script was uncommenting this line:
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-avresample"
to compile the libavresample library.
Edit: It's not working with armv7 and armv7s however, using iOS 7.1 SDK. If I find a solution I'll post here.
For building ffmpeg iOS libraries you can use this little scripts.
Download ffmpeg source
Download https://github.com/wang-bin/build_ffmpeg
Open terminal and run export FFSRC=/path/to/ffmpeg
Goto build_ffmpeg folder and run: ./ios.sh
After successful building, result will be in sdk-ios folder
Add include folder and lib folder in your Xcode project
Hope someone can shed a light on this issue for me. I am building ruby 32bit in RHEL 6 x86_64 using rvm. Followed this guide(ignored Mac related stuffs), I ran
rvm_archflags="-arch i386" CFLAGS="-arch i386" LDFLAGS="-arch i386"
rvm install 1.9.2
I get an error like this:
Error running './configure --disable-install-doc --prefix=/home/deploy/.rvm/rubies/ruby-1.8.7-p371 --enable-shared'
Trying original method: rvm install 1.8.7 --32 and got this:
'env MACOSX_DEPLOYMENT_TARGET= CFLAGS=-O3 -arch i386 -g -Os -pipe
-no-cpp-precomp CCFLAGS=-arch i386 -g -Os -pipe CXXFLAGS=-arch i386 -g -Os -pipe LDFLAGS=-arch i386 -bind_at_load LDSHARED=cc -arch i386 -dynamiclib -undefined suppress -flat_namespace ./configure --disable-install-doc --prefix=/home/deploy/.rvm/rubies/ruby-1.8.7-p371 --enable-shared'
Looking at the config.log, it says C compiler cannot create executables. From the look of the errors, I guess it mismatched the target machine(Mac instead of RHEL). I don't quite understand why because the gcc is definitely built for x86_64 Red Hat linux. Can someone give me a hint on this issue?
Thanks alot
Compiling in 32bit requires using the -m32 option on linux. The -arch i386 option is Mac specific.
You will, of course require the full suite of 32bit development libraries.
I want to use Assimp in my upcoming ios project but having hard time to make it work. I followed the instructions from this:
How to build ASSIMP Library for iOS (Device and Simulator) with boost-library?
But Terminal keep telling me this:
rm: CMakeCache.txt: No such file or directory
/Users/hengchinsoon/Desktop/assimp/port/iOS/build_ios.sh: line 40: cmake: command not found
Building armv6 library
make: *** No rule to make target `clean'. Stop.
make: *** No rule to make target `assimp'. Stop.
cp: ./lib/libassimp.a: No such file or directory
rm: CMakeCache.txt: No such file or directory
/Users/hengchinsoon/Desktop/assimp/port/iOS/build_ios.sh: line 51: cmake: command not found
Building armv7 library
make: *** No rule to make target `clean'. Stop.
make: *** No rule to make target `assimp'. Stop.
cp: ./lib/libassimp.a: No such file or directory
rm: CMakeCache.txt: No such file or directory
/Users/hengchinsoon/Desktop/assimp/port/iOS/build_ios.sh: line 62: cmake: command not found
Building i386 library
make: *** No rule to make target `clean'. Stop.
make: *** No rule to make target `assimp'. Stop.
cp: ./lib/libassimp.a: No such file or directory
rm: ./lib/libassimp.a: No such file or directory
So I checked the assimp root folder and found out that there isn't any lib folder(which from the github descriptions, that is for windows usage). So i just made lib folder and try again. But still not working.
Can anybody share with me which part I did wrongly? Thanks!
Say if I successfully install whatever I need to install, then how to really use the library?
Should I copy the lib/ios/ folder into my ios projects?
What I want to do is to import some .blend files then I can experiment on the shader and other cool stuffs.
I am decent ios developer and have basic understanding of OpenGL ES. Somehow the Assimp document confused me about what it does. I am not so sure if I don't understand Assimp at the core concept level or at the programming level. But I am still convinced that it is very flexible and powerful.
Thanks for helping.
I'm guessing that you are using the "buil_ios.sh" script, in that script there are a few errors.
You should first download Cmake from : Cmake Download
Install Cmake and then do the following.
First of all, I think that besides that output you are getting some message that tells you that some options that you put in the Cmake are not being used. That's because in the script the name of some vars are not well written.
Besides this, you should change the CMakeLists.txt file so you don't get an error while you try to build the library:
Define here the needed parameters
set (ASSIMP_SV_REVISION 1023) <-- It should be less than 1024.
set (ASSIMP_VERSION ${ASSIMP_VERSION_MAJOR}) <-- here you will find some parameters like this. (parameter0).(parameter1)...
Mac OS doesn't like to put names using this nomenclature: parameter0.parameter1.paramter.2.a I guess it's because of the '.'.
So after a long day I finally managed to build the library. Another options is to get the library compiled from the project openframeworks, the path it's this: "/addons/ofxAssimpModelLoader/libs/assimp/lib/ios/assimp.a"
Here you have a link to the library
There you can find the library already compiled for the arm6 arm7 and i386 architectures.
I'm going to put you the script modified here.
#!/bin/sh
# build.sh
#######################
# BUILD ASSIMP for iOS and iOS Simulator
#######################
BUILD_DIR="./lib/ios"
IOS_BASE_SDK="5.0"
IOS_DEPLOY_TGT="3.2"
setenv_all()
{
# Add internal libs
export CFLAGS="$CFLAGS"
export CPP="$DEVROOT/usr/bin/llvm-cpp-4.2"
export CXX="$DEVROOT/usr/bin/llvm-g++-4.2"
export CXXCPP="$DEVROOT/usr/bin/llvm-cpp-4.2"
export CC="$DEVROOT/usr/bin/llvm-gcc-4.2"
export LD=$DEVROOT/usr/bin/ld
export AR=$DEVROOT/usr/bin/ar
export AS=$DEVROOT/usr/bin/as
export NM=$DEVROOT/usr/bin/nm
export RANLIB=$DEVROOT/usr/bin/ranlib
export LDFLAGS="-L$SDKROOT/usr/lib/"
export CPPFLAGS=$CFLAGS
export CXXFLAGS=$CFLAGS
}
setenv_arm6()
{
unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS$IOS_BASE_SDK.sdk
export CFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -miphoneos-version-min=$IOS_DEPLOY_TGT -I$SDKROOT/usr/include/"
setenv_all
rm CMakeCache.txt
cmake -G 'Unix Makefiles' -DCMAKE_TOOLCHAIN_FILE=./port/iOS/IPHONEOS_ARM6_TOOLCHAIN.cmake -DENABLE_BOOST_WORKAROUND=ON -DBUILD_STATIC_LIB=ON -DASSIMP_BUILD_STATIC_LIB=ON
}
setenv_arm7()
{
unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS$IOS_BASE_SDK.sdk
export CFLAGS="-arch armv7 -pipe -no-cpp-precomp -isysroot $SDKROOT -miphoneos-version-min=$IOS_DEPLOY_TGT -I$SDKROOT/usr/include/"
setenv_all
rm CMakeCache.txt
cmake -G 'Unix Makefiles' -DCMAKE_TOOLCHAIN_FILE=./port/iOS/IPHONEOS_ARM7_TOOLCHAIN.cmake -DENABLE_BOOST_WORKAROUND=ON -DBUILD_STATIC_LIB=ON -DASSIMP_BUILD_STATIC_LIB=ON
}
setenv_i386()
{
unset DEVROOT SDKROOT CFLAGS CC LD CPP CXX AR AS NM CXXCPP RANLIB LDFLAGS CPPFLAGS CXXFLAGS
export DEVROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneSimulator$IOS_BASE_SDK.sdk
export CFLAGS="-arch i386 -pipe -no-cpp-precomp -isysroot $SDKROOT -miphoneos-version-min=$IOS_DEPLOY_TGT"
setenv_all
rm CMakeCache.txt
cmake -G 'Unix Makefiles' -DCMAKE_TOOLCHAIN_FILE=./port/iOS/IPHONEOS_i386_TOOLCHAIN.cmake -DENABLE_BOOST_WORKAROUND=ON -DBUILD_STATIC_LIB=ON -DASSIMP_BUILD_STATIC_LIB=ON
}
create_outdir()
{
for lib_i386 in `find $BUILD_DIR/i386 -name "lib*\.a"`; do
lib_arm6=`echo $lib_i386 | sed "s/i386/arm6/g"`
lib_arm7=`echo $lib_i386 | sed "s/i386/arm7/g"`
lib=`echo $lib_i386 | sed "s/i386\///g"`
echo 'Creating fat binary...'
lipo -arch armv6 $lib_arm6 -arch armv7 $lib_arm7 -arch i386 $lib_i386 -create -output $lib
done
echo 'Done! You will find the libaries and fat binary library in /lib/ios'
}
cd ../../
rm -rf $BUILD_DIR
mkdir -p $BUILD_DIR/arm6 $BUILD_DIR/arm7 $BUILD_DIR/i386
setenv_arm6
echo 'Building armv6 library'
make clean
make assimp -j 8 -l
cp ./lib/libassimp.a $BUILD_DIR/arm6/
setenv_arm7
echo 'Building armv7 library'
make clean
make assimp -j 8 -l
cp ./lib/libassimp.a $BUILD_DIR/arm7/
setenv_i386
echo 'Building i386 library'
make clean
make assimp -j 8 -l
cp ./lib/libassimp.a $BUILD_DIR/i386/
rm ./lib/libassimp.a
create_outdir
I read somewhere that an alternative to this is to use openframeworks since it already incorporate assimp lib.
http://www.openframeworks.cc/download/
look for ios version. and inside there is a folder contain example/ios/assimpExample/ folder would be a good starting point.
Have fun!:D
The boost root for me on Mac with the latest version of Homebrew is the following:
BOOST_ROOT=~/.homebrew/Cellar/boost/1.53.0
Your version of boost may be different, so the last folder will vary. But as of a recent homebrew version, Cellar gets install within the current user's home directory.