I have written a C++ library and its cmake. I'm trying to get that library ported on Android so that I can use the library there. I'm trying to generate .so files so that I can link it in JNI.
%Path to android sdk cmake%\cmake -G Ninja . ^
-GAndroid Gradle - Ninja ^
-DANDROID_ABI=armeabi-v7a ^
-DANDROID_NDK=%Path to android sdk%\Sdk\ndk-bundle ^
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=%OUTPUT% ^
-DCMAKE_BUILD_TYPE=Debug ^
-DCMAKE_MAKE_PROGRAM=%Path to android sdk ninja% ^
-DCMAKE_TOOLCHAIN_FILE=%Path to android sdk%\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake ^
-DANDROID_NATIVE_API_LEVEL=29 ^
-DANDROID_TOOLCHAIN=clang
I get the following error
CMake Error: Could not create named generator Android
On Windows, I do the following to configure it to MSVC:
cmake -G "Visual Studio 15 2017 Win64" ..
So how do I get about building the native library from the same C++ source on Windows and what would the correct CMake command be. It is fine even if it configures to android studio.