1#!/bin/bash 2 3here=$(cd $(dirname "$0"); /bin/pwd) 4 5# usage: run_cmake-osx [-g] 32|64 6 7tmp="tmp" 8buildtype="Release" 9 10if [ "$1" = "-g" ]; then 11 tmp="tmp_debug" 12 buildtype="Debug" 13 shift 14fi 15 16case "$1" in 17 32) APPLE_ARCH=i386 ; shift ;; 18 64) APPLE_ARCH=x86_64 ; shift ;; 19 *) echo "usage: $0 32|64" >&2; exit 1 ;; 20esac 21 22WXWIN=$(wx-config --prefix) 23[ -d "$WXWIN" ] || { 24 echo "could not find wxWidgets insalltation" >&2 25 exit 1 26} 27 28cd $here 29mkdir -p $tmp 30cd $tmp 31 32cmake -G "Unix Makefiles" \ 33 -DwxWidgets_PREFIX_DIRECTORY=$WXWIN \ 34 -DAPPLE_ARCH=$APPLE_ARCH \ 35 -DCMAKE_BUILD_TYPE=$buildtype \ 36 ${1+"$@"} .. 37