Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. CMake
  3. android-cmake

android-cmake

CMake

CMake toolchain file and scripts for building native C/C++ code with the Android NDK.

GitHubGitHub
1.2k stars430 forks0 contributors

What is android-cmake?

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.

Target Audience

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.

Value Proposition

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.

Overview

CMake toolchain file and other scripts for the Android NDK

Use Cases

Best For

  • Porting existing CMake-based C/C++ projects to Android
  • Building native Android libraries with complex CMake configurations
  • Developing Android applications with mixed Java and native C/C++ components
  • Cross-compiling performance-critical code for multiple Android ABIs
  • Using modern CMake features while targeting Android platforms
  • Integrating third-party C/C++ libraries into Android projects via CMake

Not Ideal For

  • Projects requiring armeabi-v7a-hard ABI for enhanced floating-point performance
  • Teams that depend on libc++ STL runtime (static or shared) as their C++ standard library
  • Build pipelines needing single-command compilation for multiple Android ABIs (e.g., using ndk-build's multi-ABI support)
  • Environments where the official ndk-build system is mandated or preferred without CMake integration

Pros & Cons

Pros

Automatic NDK Discovery

Searches for Android NDK in standard paths and environment variables, reducing manual configuration overhead, as it automatically locates NDK installs from common locations.

Comprehensive ABI Support

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.

CMake Native Integration

Provides a toolchain file that seamlessly integrates Android NDK with CMake, enabling cross-compilation using CMake's standard commands and workflows.

Flexible Toolchain Configuration

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.

Cons

Restricted Build Configurations

Forces use of only Release or Debug build types, unlike standard CMake which supports more configurations, potentially limiting development and testing workflows.

Incomplete ndk-build Feature Parity

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.

No Multi-ABI Single Build

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.

Frequently Asked Questions

Quick Stats

Stars1,230
Forks430
Contributors0
Open Issues23
Last commit8 years ago
CreatedSince 2012

Tags

#clang#gcc#build-tools#cross-compilation#android-ndk#cmake#c-plus-plus#native-development#toolchain

Built With

G
GCC
A
Android NDK
N
Ninja
C
Clang
C
CMake

Included in

CMake5.4k
Auto-fetched 15 hours ago

Related Projects

dockcrossdockcross

Cross compiling toolchains in Docker images

Stars3,576
Forks425
Last commit17 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub