I've found a way to cross-compile this lib with Android tools.
Here are the command lines to generate, for example, the arm64-v8a version
> [CMAKE_BIN_PATH]/cmake -DANDROID_ABI=arm64-v8a -DCMAKE_BUILD_TYPE=Release -DANDROID_PLATFORM=android-21 -DANDROID_NDK=[NDK_PATH] -DCMAKE_INSTALL_PREFIX=install -DCMAKE_TOOLCHAIN_FILE=[NDK_PATH]/build/cmake/android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=[CMAKE_BIN_PATH]/ninja -G Ninja
> [CMAKE_BIN_PATH]/ninja
> [CMAKE_BIN_PATH]/ninja install
or, in a one-line version
> [CMAKE_BIN_PATH]/cmake -DANDROID_ABI=arm64-v8a -DCMAKE_BUILD_TYPE=Release -DANDROID_PLATFORM=android-21 -DANDROID_NDK=[NDK_PATH] -DCMAKE_INSTALL_PREFIX=install -DCMAKE_TOOLCHAIN_FILE=[NDK_PATH]/build/cmake/android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=[CMAKE_BIN_PATH]/ninja -G Ninja && [CMAKE_BIN_PATH]/ninja && [CMAKE_BIN_PATH]/ninja install
In details:
- [CMAKE_BIN_PATH] is the path of cmake: /Library/Android/sdk/cmake/3.6.4111459/bin
- [NDK_PATH] is the path of the NDK: /Library/Android/sdk/ndk-bundle
- CMAKE_INSTALL_PREFIX is a flag to specify the install dir. In my case, I've decided to create the install dir in the libtiff dir
- CMAKE_TOOLCHAIN_FILE: if a flag to specify the toolchain to use. Use the Android toolchain file inside the NDK dir, and not in the cmake dir
- CMAKE_MAKE_PROGRAM is a flag to specify the path of ninja, located in the cmake dir
- -G is the specify the build system generator, Ninja here