Improved VES/KiwiViewer build with Eclipse and CMake on Linux, Mac, and Windows

** This is the continuation (or improved version) of our previous post  on this topic:



VES ( is VTK for Embedded Systems. It is a C++ rendering library for mobile devices using OpenGL ES 2.0. VES integrates with the Visualization Toolkit (VTK) to deliver:

  • Scientific and medical visualization capabilities
  • Remote rendering and/or data hosting
  • Modern/novel/new/collaborative interaction techniques

Recently, we made improvements to building VES (specifically KiwiViewer) for Android on Linux and Mac and Windows using CMake and Eclipse. The build procedure requires Android NDK, Android SDK, and Java JDK  to be installed on the system.  VES includes an example application called KiwiViewer.  This blog will describe how to build VES, and then build KiwiViewer. The blog will also cover how to install and setup the correct Android development environment.


Installing the development environment

Download and install the Android SDK from here: For Windows, you should download and install the ADT Bundle for Windows (a .zip file).  There is no executable installer.  You will just have to unzip this into a directory.  For this example, the file is unzipped o C:/Users/hoffman/android-windows. Also, download and install the NDF from here:

You will also need Java JDK as well.  In our setup, it is installed here: c:/Program\ Files\ \(x86\)/Java/. Below are the steps for building VES.


1. Get a copy of VES

> git clone git://

> git checkout master


2. Open a VS Command Prompt and then type following commands.

> set ANDROID_NDK=c:\Users\hoffman\android-windows\android-ndk-r9


3. Run cmake-gui from command line.

> “\Program Files (x86)\CMake 2.8\bin\cmake-gui.exe”




5. Run jom in build directory or nmake if you want to wait.  🙂

> cd ‘build dir from above’

> \Users\hoffman\jom\jom.exe


6. Build Kiwi.

Run cmake-gui on Kiwi, be sure to use toolchain option.

> CMAKE_TOOLCHAIN_FILE:FILEPATH=C:/Users/hoffman/Work/VES/CMake/toolchains/android.toolchain.cmake


7. Use the cache it creates.

> c:\Users\hoffman\Work\VES4\VES-build\Apps\KiwiAndroid>”\Program Files (x86)\CMake 2.8\bin\cmake-gui.exe” ..\..\..\VES\Apps\Android\Kiwi ANDROID_EXECUTABLE:FILEPATH=C:/Users/hoffman/android-windows/adt-bundle-windows-x86_64-20130917/sdk/tools/android.bat ANT_EXECUTABLE:FILEPATH=C:/Users/hoffman/android-windows/adt-bundle-windows-x86_64-20130917/eclipse/plugins/org.apache.ant_1.8.3.v201301120609/bin/ant.bat

You will have to set VTK_DIR and VES_DIR appropriately. Set it to the VES and VTK build directories created by the superbuild.

8. Put javac in the PATH and set JAVA_HOME

> set PATH=%PATH%;c:\Program Files (x86)\Java\jdk1.7.0_03/bin

> set JAVA_HOME=c:\Program Files (x86)\Java\jdk1.7.0_03


9. Prevent java from running out of memory during compile.

> set _JAVA_OPTIONS=”-Xmx256M”


11. Run nmake or jom in build tree and then run eclipse from the command line

> \Users\hoffman\eclipse\eclipse\eclipse.exe


That’s all to it.  AndroidManifest.xml is only done at configure time, this needs to be moved to build time, so that clean works. On Ubuntu you will need 32 bit libs: If you need help installing and configuring Java on your development machine, you might find these resources helpful:

Here are the steps to install Java and Eclipse, prior to installing the Android SDK and ADT Plugin. If you are running a 64-bit distribution on your development machine, you need to install the ia32-libs package using apt-get:

> apt-get install ia32-libs

Next, install Java.

> apt-get install sun-java6-jdk

The Ubuntu package manager does not currently offer an Eclipse 3.6 version for download, so we recommend that you download Eclipse from ( downloads/). A Java or RCP version of Eclipse is recommended. Follow the steps given in previous sections to install the SDK and the ADT plugin. Information for other platforms.


9 Responses to Improved VES/KiwiViewer build with Eclipse and CMake on Linux, Mac, and Windows

  1. Pingback: Cameron Lowell Palmer

  2. Pingback: Gioele Luchetti

  3. Pingback: Cameron Lowell Palmer

  4. Pingback: Cameron Lowell Palmer

  5. Pingback: Lonni Besançon

  6. Pingback: Casey Goodlett

  7. Pingback: Casey Goodlett

  8. Pingback: Lonni Besançon

  9. Pingback: Kyle

Questions or comments are always welcome!