Skip to content

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

License

Notifications You must be signed in to change notification settings

BareCpper/AndroidPackaging.cmake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages