Cross-compiling FreeType for Android with CMake

Freetype provides a Makefile with a configure utility that makes it fairly easy to cross-compile for other platforms, however there are a lot of examples on the web (as well as some solutions) of people having difficulty in it.

My intention is to cross-compile FreeType using the Android NDK into a static library that can ultimately be used by libRocket for font rendering in HTML+CSS based UIs in OpenGL applications. I’m using the CMake build system for cross-platform builds and the android-cmake project to create a CMake toolchain for the NDK. This requires creating a CMakeLists.txt for FreeType as it doesn’t currently provide one.

The CMakeLists.txt file included below is based on the FreeType-2.4.8 release and is a result of converting the Jamfile and Makefile to CMake. Its intention is simply to allow compilation with CMake. For standard build and installs I would recommend following the instructions in the docs/INSTALL file from the FreeType directory. Note: This file will try and build *all* of FreeType2′s modules as defined in include/freetype/config/ftmodule.h. If you don’t want to build some of these modules please edit that file and remove the macro calls. Continue reading

Building Boost 1.47 for Android using CMake and the NDK

The Boost library is incredibly useful in cross-platform C++ software development. Building Boost for Android can be a bit troublesome and several patches need to be applied to the code. Mystic Games provides a project on GitHub called Boost for Android which at the time of writing worked with official NDK r5c and Boost version 1.45. See after the break for more information.

Continue reading

Notes on Android Graphics and Animations

This post contains my notes on the Youtube Video “Learn about Android Graphics & Animations from Google’s Android UI Toolkit Team” which shows a talk given by Romain Guy and Chet Haase from Google at the San Francisco Android User Group, Nov 20th 2010. Note that at the time of writing the video is already quite old, but much of it is still relevant and it’s well worth a watch for anybody interested in working with graphics in Android. This post is partly for me to remember and refer back to, but hopefully others will find it useful. The video is embedded below and notes can be found after the break:

Continue reading