CMake toolchain file and scripts for building native C/C++ code with the Android NDK.
android-cmake is a collection of CMake scripts and a toolchain file that enables developers to build native C/C++ code for Android using the Android NDK. It provides a CMake-based alternative to the traditional ndk-build system, allowing projects using CMake as their build system to target Android platforms seamlessly. The project originated from experience porting the OpenCV library to Android and aims to share these scripts with the broader Android NDK community.
Android developers and C/C++ engineers who need to build native libraries or applications for Android using CMake as their build system, particularly those porting existing CMake-based projects to the Android platform.
Developers choose android-cmake because it integrates CMake's powerful cross-platform build capabilities with Android's native development requirements, providing a familiar workflow for CMake users while handling Android-specific complexities like ABI selection, toolchain configuration, and NDK discovery automatically.
CMake toolchain file and other scripts for the Android NDK
Searches for Android NDK in standard paths and environment variables, reducing manual configuration overhead, as it automatically locates NDK installs from common locations.
Builds for a wide range of Android ABIs including armeabi-v7a, x86, arm64-v8a, and more, with detailed options listed in the README for targeting different architectures.
Provides a toolchain file that seamlessly integrates Android NDK with CMake, enabling cross-compilation using CMake's standard commands and workflows.
Allows selection of various GCC and Clang compiler versions and STL runtimes like GNU STL or STLport, as detailed in the ANDROID_TOOLCHAIN_NAME and ANDROID_STL options.
Forces use of only Release or Debug build types, unlike standard CMake which supports more configurations, potentially limiting development and testing workflows.
Lacks support for key ndk-build features such as armeabi-v7a-hard ABI and libc++ STL runtime, as admitted in the README, which may hinder projects relying on these.
Requires separate CMake invocations for each Android ABI, unlike ndk-build's ability to compile for multiple platforms in one command, increasing build complexity and time.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.