2

I put you in a situation to know what I need. I have some source code to make a tracking system based on ORB. I have 3 folders that I have to generate libraries. At the same time I have another carp that is responsible for calling the functions of the other libraries to use them in the main program. The code used in these folders is C ++.

The previous projects, I have managed to integrate these libraries into an Android project using the JNI method and compile it with NDK-build.

In the case of now I have to use Cmake to compile the different folders. Here's my question: How do I use the NDK compiler using cmake, without using Android Studio to generate shared libraries (.so)?

  • A good place to start would be to look at this [CMake toolchain file for Android](https://github.com/taka-no-me/android-cmake/blob/master/android.toolchain.cmake). Sets up CMake correctly, and explains in the comments what you need to setup prior to building. – JBL Feb 23 '18 at 14:16
  • is it possible using only cmakelists and windows command lines? – Urko Sanchez Ortiz Feb 23 '18 at 14:18
  • 1
    yes it is possible with something like `cmake .. -DCMAKE_TOOLCHAIN_FILE=%ANDROID_NDK%\build\cmake\android.toolchain.cmake -DCMAKE_SYSTEM_NAME="Android" -DANDROID_NDK=%ANDROID_NDK% -DANDROID_TOOLCHAIN=clang -DANDROID_PLATFORM=android-24 -T "ClangDefault"` – N0dGrand87 Aug 04 '18 at 00:58

0 Answers0