Unable to build opencv for android using cmake
I managed to build OpenCV 2.4.9 for java following the online instructions.
However I am unable to build for Android
I am using OSX Yosemite, CMake 3.0.2, OpenCV 2.4.9.
The output I get is the following:
======
platforms [2.4.9] % sh ./scripts/cmake_android_arm.sh CMake Error at platforms/android/android.toolchain.cmake:827 (list): list index: 17 out of range (-17, 16) Call Stack (most recent call first): platforms/build_android_arm/CMakeFiles/3.0.2/CMakeSystem.cmake:6 (include) CMakeLists.txt:56 (project)
-- Detected version of GNU GCC: 49 (409) -- Performing Test HAVE_CXX_WERROR_ADDRESS CMake Error at /Users/mam/Source/opencv/platforms/android/android.toolchain.cmake:711 (list): list sub-command REMOVE_DUPLICATES requires list to be present. Call Stack (most recent call first): /Users/mam/Source/opencv/platforms/build_android_arm/CMakeFiles/3.0.2/CMakeSystem.cmake:6 (include) CMakeLists.txt:2 (project)
CMake Error at /Users/mam/Source/opencv/platforms/android/android.toolchain.cmake:712 (list): list sub-command SORT requires list to be present. Call Stack (most recent call first): /Users/mam/Source/opencv/platforms/build_android_arm/CMakeFiles/3.0.2/CMakeSystem.cmake:6 (include) CMakeLists.txt:2 (project)
CMake Error at /Users/mam/Source/opencv/platforms/android/android.toolchain.cmake:718 (message): No one of known Android ABIs is supported by this cmake toolchain. Call Stack (most recent call first): /Users/mam/Source/opencv/platforms/build_android_arm/CMakeFiles/3.0.2/CMakeSystem.cmake:6 (include) CMakeLists.txt:2 (project)
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage CMake Error: Internal CMake error, TryCompile configure of cmake failed -- Configuring incomplete, errors occurred! See also "/Users/mam/Source/opencv/platforms/build_android_arm/CMakeFiles/CMakeOutput.log".
======
I tried setting both: export ANDROID_NDK=~/android-ndk-r8e and export ANDROID_STANDALONE_TOOLCHAIN=~/android-toolchain
but both give same error. Any clues to what is causing this? Bad version of CMake?