VTK for Android

Hi,

i’m the author of the post you mentioned, build VTK with recent versions of NDK is still messy but i have retried it because NDK r16b was too old to be used for my own code and others dependencies.

I found another workaround to get VTK compiled with NDK r21e but this time without backend librairies if you don’t need to render things and use only others common functions. Here is the portion of my documentation with instructions:

# Install VTK (8.2.0) from sources
cd ~/libs
git clone https://github.com/Kitware/VTK.git
cd VTK
git checkout v8.2.0
# Manually disable those backend modules in CMake/vtkAndroid.cmake
# -DModule_vtkInteractionStyle:BOOL=OFF
# -DModule_vtkRenderingCore:BOOL=OFF
# -DModule_vtkRenderingFreeType:BOOL=OFF
# -DModule_vtkTestingRendering:BOOL=OFF
# -DModule_vtkRenderingVolumeOpenGL2:BOOL=OFF
mkdir build && cd build
cmake .. \
-DVTK_ANDROID_BUILD=ON \
-DANDROID_NDK=$ANDROID_NDK_PATH \
-DANDROID_NATIVE_API_LEVEL=28 \ 
-DANDROID_ARCH_ABI=arm64-v8a \
-DCMAKE_BUILD_TYPE=Release
make -j8
cp -r CMakeExternals/Install/vtk-android/* $ANDROID_ARM64_V8A_INSTALL_PREFIX

But i don’t giving up to make thoses backend librairies found by linker with recent NDK versions.

I hope this can help you.