PATH=/usr/src/ndk-standalone-9/bin:$PATH
cd /usr/src/freeglut-3.0.0/
+ mkdir cross-android-module/
+ cd cross-android-module/
cmake \
- -D CMAKE_TOOLCHAIN_FILE=android_toolchain.cmake \
+ -D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \
-D CMAKE_INSTALL_PREFIX=/freeglut \
-D FREEGLUT_GLES2=ON \
-D FREEGLUT_BUILD_DEMOS=NO \
- .
+ ..
make -j4
make install DESTDIR=$(pwd)
PATH=/usr/src/ndk-standalone-9/bin:$PATH
cd /usr/src/freeglut-3.0.0/
+ mkdir cross-android-toolchain/
+ cd cross-android-toolchain/
cmake \
- -D CMAKE_TOOLCHAIN_FILE=android_toolchain.cmake \
+ -D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \
-D CMAKE_INSTALL_PREFIX=/usr/src/ndk-standalone-9 \
-D FREEGLUT_GLES2=ON \
-D FREEGLUT_BUILD_DEMOS=NO \
- .
+ ..
make -j4
make install
For instance if you use the autotools:
PATH=/usr/src/ndk-standalone-9/bin:$PATH
- PKG_CONFIG_PATH=/usr/src/ndk-standalone-9/share/pkgconfig
+ export PKG_CONFIG_PATH=/usr/src/ndk-standalone-9/share/pkgconfig
./configure --host=arm-linux-androideabi --prefix=/somewhere
make
make install
'android_toolchain.cmake':
PATH=/usr/src/ndk-standalone-9/bin:$PATH
- PKG_CONFIG_PATH=/usr/src/ndk-standalone-9/share/pkgconfig
+ export PKG_CONFIG_PATH=/usr/src/ndk-standalone-9/share/pkgconfig
cp .../android_toolchain.cmake .
+ mkdir cross-android/
+ cd cross-android/
cmake \
- -D CMAKE_TOOLCHAIN_FILE=android_toolchain.cmake
+ -D CMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake \
-D CMAKE_INSTALL_PREFIX=/somewhere \
-D MY_PROG_OPTION=something ... \
- .
+ ..
make -j4
make install