Reputation: 2518
I have a android-ndk based app, which is built with cmake, and I want to integrate that project into an AOSP-build and have it included in the resulting android image. However there seems to be no possibility to directly start a cmake build in the AOSP build system.
For example in the android-7.1.1._r35 source tree, the zlib-external has a CMakeLists.txt, but additionally an Android.mk file, which seems to actually be used for compilation with AOSP instead of cmake. The build instructions are duplicated in both files:
external/zlib/src/CMakeLists.txt
external/zlib/Android.mk
Since the project has quite a lot of source files (~1500 cpps), I'm trying to avoid the tedious task of converting and maintaining an extra build system.
Is it possible to invoke a cmake build from the Android.mk based build system or do I have to write an Android.mk file to build my app? If cmake can be called, how do I do it?
Upvotes: 5
Views: 2510
Reputation: 179
SHELL_RESULT := $(shell ($(LOCAL_PATH)/run_cmake.sh))
Upvotes: 0
Reputation: 2518
For the record, in case someone stumbles upon this in the future: There seems to be a solution, though it's hacky - see Build gradle system app as part of AOSP build for reference. This solution seems to work, but the gradle/cmake build is started directly when the makefiles are parsed.
Upvotes: 1
Reputation: 10509
It is not possible to build cmake projects in the AOSP build system.
Upvotes: 0