[vtk-developers] Constructing Android.mk files for ndk-build

Ben Boeckel ben.boeckel at kitware.com
Sun Oct 26 22:44:03 EDT 2014


On Sun, Oct 26, 2014 at 13:15:22 +0000, Cameron Lowell Palmer wrote:
> Has anyone ever built Kiwi-VES using ndk-build and Android.mk? If so,
> can we share?
> 
> My current strategy is to statically compile vtk-android and roll up
> all the output of the vtk superbuild as a single libvtk-android.a.
> I?ve used GNU ar to roll up all of the .a files. Then I?ll leave our
> custom Kiwi and VES code as source. This will allow me to build the
> NDK portion in the standard Android fashion. My current obstacle is
> the compilation of libarchive which seems to be a requirement of our
> kiwi code.
> 
> If anyone is interested it would be fairly trivial to try this with
> unmodified VES-Kiwi and put it up on github. Just let me know.

Here[1]'s a (non-Kitware related) project which uses ndk-build for the
Android bits, but CMake for the main build. Basically, you cross compile
using the NDK toolchain with CMake, then have the Android bits "install"
the binaries you're interested as an "external" NDK library[2]. Making a
"super" library of all the enabled modules shouldn't be too hard to do
just in the android build (so that umpteen libraries don't need
"installed"). No need to set up the entire Android.mk infrastructure for
all of VTK.

--Ben

[1]https://github.com/mathstuf/abagames-gunroar/blob/master/src/android/CMakeLists.txt
[2]https://github.com/mathstuf/abagames-gunroar/blob/master/src/android/jni/gunroar/Android.mk


More information about the vtk-developers mailing list