středa 8. června 2011

Android + CMake is much easier in ndk-r5b

About a year or two ago we struggled to make regular CMake usage with Android easy, time has changed and with the newer Android ndk releases things are straightforward.

Bellow is content of script. To use it with CMake do following

  1. open command line + cd  to your project directory with CMakelist.txt
  2. .  ./
  3. ccmake .


export NDK=/home/vasek/android-ndk-r5b


export CC="$NDK/$MIDDLE/${PREF}gcc  --sysroot=$SYSROOT"
export CXX="$NDK/$MIDDLE/${PREF}g++  --sysroot=$SYSROOT"
export LD="$NDK/$MIDDLE/${PREF}ld  --sysroot=$SYSROOT"
export CPP="$NDK/$MIDDLE/${PREF}cpp  --sysroot=$SYSROOT"
export AS="$NDK/$MIDDLE/${PREF}as  --sysroot=$SYSROOT"
export OBJCOPY="$NDK/$MIDDLE/${PREF}objcopy  --sysroot=$SYSROOT"
export OBJDUMP="$NDK/$MIDDLE/${PREF}objdump  --sysroot=$SYSROOT"
export STRIP="$NDK/$MIDDLE/${PREF}strip  --sysroot=$SYSROOT"
export RANLIB="$NDK/$MIDDLE/${PREF}ranlib  --sysroot=$SYSROOT"
export CCLD="$NDK/$MIDDLE/${PREF}gcc  --sysroot=$SYSROOT"
export AR="$NDK/$MIDDLE/${PREF}ar  --sysroot=$SYSROOT"

1 komentář: