Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 2 KB

README.md

File metadata and controls

48 lines (33 loc) · 2 KB

AndroidPackaging.cmake

Android APK Cmake build for NDK Activity and eventual native Services support.

Prerequisites

  1. Use CMake to build your project.
  2. Structure your project. See Here.
  3. Use modern CMake features like targets and properties. See here and here.

Using AndroidPackaging.cmake

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.

Basic Usage

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
)

Advantages

  • 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

Limitations

  • 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