Bellow is content of android_env.sh script. To use it with CMake do following
- open command line + cd to your project directory with CMakelist.txt
- . ./android_env.sh
- ccmake .
#!/bin/sh
export NDK=/home/vasek/android-ndk-r5b
SYSROOT=$NDK/platforms/android-9/arch-arm
MIDDLE=toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/
PREF=arm-linux-androideabi-
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"
Thanks for this script.
OdpovědětVymazat