summaryrefslogtreecommitdiff
path: root/cmake/configure-iphone.sh
blob: 3596e487427e5d821ceb38b9acd9f976ba8253c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/bash
# Usage: accepts 2 arguments - in order - SDK version, root of the source
# Anything after those first two commands are passed to CMake
if [ $# -lt 2 ]
then
	echo "usage: $0 <SDK Version> <root of build> [additional CMake parameters]"
	exit
fi

unset CPATH
unset C_INCLUDE_PATH
unset CPLUS_INCLUDE_PATH
unset OBJC_INCLUDE_PATH
unset LIBS
unset DYLD_FALLBACK_LIBRARY_PATH
unset DYLD_FALLBACK_FRAMEWORK_PATH

export SDKVER="$1"
shift
export DEVROOT="/Developer/Platforms/iPhoneOS.platform/Developer"
export SDKROOT="$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk"
export PKG_CONFIG_PATH="$SDROOT/usr/lib/pkgconfig":"/opt/iphone-$SDKVER/lib/pkgconfig":"/usr/local/iphone-$SDKVER/lib/pkgconfig"
export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH"
export MAINFOLDER=$1
shift

cmake \
     -DCMAKE_TOOLCHAIN_FILE="$MAINFOLDER/cmake/toolchains/iphone-$SDKVER.toolchain" \
     -DCMAKE_INSTALL_PREFIX="/opt/iphone-$SDKVER" \
	$MAINFOLDER $*