[vtkusers] Android Build Questions

Daniel Alejandro Fuentes danieldaf2000 at gmail.com
Mon Apr 6 15:05:54 EDT 2015


Hi, I'm trying to build VTK for android using cmake on Linux.
I download the source from https://gitlab.kitware.com/vtk/vtk.git
and made a branch based on v6.2.0 tag.

First, I build VTK for linux without problmes. I verify and the .so are
generated ok.
I wish the same results, for Android.
So, I rebuild (on another build directory) for androd.

My first problem, was that the installation process of 'vtl-compile-tools'
was failed. Because I don't have rights for write on /usr/local
For resolv that, I replaced the macro:

# Compile a minimal VTK for its compile tools
macro(compile_vtk_tools)
  ExternalProject_Add(
    vtk-compile-tools
    SOURCE_DIR ${CMAKE_SOURCE_DIR}
    PREFIX ${PREFIX_DIR}/vtk-compile-tools
    BINARY_DIR ${BUILD_DIR}/vtk-compile-tools
    ${VTK_BUILD_COMMAND} vtkCompileTools
    CMAKE_ARGS
      -DCMAKE_BUILD_TYPE:STRING=Release
      -DVTK_BUILD_ALL_MODULES:BOOL=OFF
      -DVTK_Group_Rendering:BOOL=OFF
      -DVTK_Group_StandAlone:BOOL=ON
      -DBUILD_SHARED_LIBS:BOOL=ON
      -DBUILD_EXAMPLES:BOOL=OFF
      -DBUILD_TESTING:BOOL=OFF
  )
endmacro()

with:

# Compile a minimal VTK for its compile tools
macro(compile_vtk_tools)
  ExternalProject_Add(
    vtk-compile-tools
    SOURCE_DIR ${CMAKE_SOURCE_DIR}
    PREFIX ${PREFIX_DIR}/vtk-compile-tools
    BINARY_DIR ${BUILD_DIR}/vtk-compile-tools
    ${VTK_BUILD_COMMAND} vtkCompileTools
    CMAKE_ARGS
      -DCMAKE_BUILD_TYPE:STRING=Release
      -DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_DIR}/vtk-compile-tools
      -DVTK_BUILD_ALL_MODULES:BOOL=OFF
      -DVTK_Group_Rendering:BOOL=OFF
      -DVTK_Group_StandAlone:BOOL=ON
      -DBUILD_SHARED_LIBS:BOOL=ON
      -DBUILD_EXAMPLES:BOOL=OFF
      -DBUILD_TESTING:BOOL=OFF
  )
endmacro()

on the file:

CMake/vtkAndroid.cmake

I try run make again, and all process finish successful. But only static
libraries were generated!! (.a).
So I change the file 'CMake/vtkAndroid.cmake'  to force to build
vtk-android with var BUILD_SHARED_LIBS activated.
Again, I try to run make but I found many errors.
Some of them are concerned with NDK, so I'm investigate now how resolv.

Meanawhile, I want to make the next questions:
a) It shuld be possible buildt shared VTK libraries for Android right now?
b) I see that some .cxx files are explicitly excluded for compilation when
OpenGL ES 2.0 are used. For what reason?

Thanks, and sorry by my poor english.
Daniel F.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150406/5a3ddb92/attachment.html>


More information about the vtkusers mailing list