Android APK Cmake build for NDK Activity and eventual native Services support.
- Use CMake to build your project.
- Structure your project. See Here.
- Use modern CMake features like targets and properties. See here and here.
We recommend using CPM.cmake so you stay upto-date with the latest fixes and features.
Alternative, you may directly include AndroidPackaging.cmake
in your project but we don't encourage this.
After adding CPM.cmake, add the following line to the CMakeLists.txt
.
include(CPM)
CPMAddPackage("gh:BareCpper/AndroidPackaging.cmake")
To use AndroidPackaging.cmake to package a Native NDK Activity into an Android APK
:
apk_add_executable( MyActivity )
target_sources( MyActivity
PRIVATE
main.cpp
)
- Small and reusable so can be added to any CMake build
- Automatic update of buil-time variables so code always has up-to date
Version.h
with no developer interaction. - Short Git-SHA available so multiple-developers can generate unique build versions.
- No re-configuring of CMake project necessary as the build-time step will udpate version information for your build transparently.
- ...lots more to think about & list
- CMake variables are cached and do not reflect the current development version.
❗ This can affect version-name when using CPack Installers. See Issue #1 - Only Git support is currently maintained but we would love you to raise an issue