taka-no-me / android-cmake

CMake toolchain file and other scripts for the Android NDK
1.22k stars 438 forks source link

Add support for NDK r16b #102

Open HIPERCUBE opened 6 years ago

HIPERCUBE commented 6 years ago

I think android-cmake doesn't support NDK r16b yet. In the NDK r16b, there's no include directory in ndk-r16b/andorid-**/arch-**/usr.

CMake Error at toolchain/android.toolchain.cmake:308 (file):
  file STRINGS file
  "/.../android-ndk-r16b/platforms/android-21/arch-arm/usr/include/android/api-level.h"
  cannot be read.
Call Stack (most recent call first):
  toolchain/android.toolchain.cmake:803 (__DETECT_NATIVE_API_LEVEL)
  /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineSystem.cmake:91 (include)
  CMakeLists.txt:2 (project)

CMake Error at toolchain/android.toolchain.cmake:805 (message):
  Specified Android API level (21) does not match to the level found ().
  Probably your copy of NDK is broken.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineSystem.cmake:91 (include)
  CMakeLists.txt:2 (project)

CMake Deprecation Warning at /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeForceCompiler.cmake:69 (message):
  The CMAKE_FORCE_C_COMPILER macro is deprecated.  Instead just set
  CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  toolchain/android.toolchain.cmake:1128 (CMAKE_FORCE_C_COMPILER)
  /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineSystem.cmake:91 (include)
  CMakeLists.txt:2 (project)

CMake Deprecation Warning at /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeForceCompiler.cmake:83 (message):
  The CMAKE_FORCE_CXX_COMPILER macro is deprecated.  Instead just set
  CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  toolchain/android.toolchain.cmake:1140 (CMAKE_FORCE_CXX_COMPILER)
  /usr/local/Cellar/cmake/3.10.1/share/cmake/Modules/CMakeDetermineSystem.cmake:91 (include)
  CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred!
hoonkai commented 6 years ago

+1

JingLiu24 commented 6 years ago

+1, any solutions?

cerkiewny commented 6 years ago

+1

yuri4029 commented 6 years ago

Hi everyone, I am very new with pangolin on android, and I confuse about how to put pangolin lib in project. I use cmake and use these commands code on project, I dont know if I right or wrong ? please help me. cmake_pangolin_anroid

yassiezar commented 6 years ago

I think this cmake script is very outdated. The newest Android NDK has a toolchain file bundled with it. It should be under {NDK_ROOT}/build/cmake/android.toolchain.cmake. Try using that one instead?

kelvin7feng commented 4 years ago

This android.toolchain.cmake is too old. You can update the NDK and modify the -DCMAKE_TOOLCHAIN_FILE=${NEW_NDK_PATH}/build/cmake/android.toolchain.cmake. Hope to help you.