Add options to the `install()` and `export()` commands to export the targets we build into Android.mk files that reference them as prebuilt libraries with associated usage requirements (compile definitions, include directories, link libraries). This will allow CMake-built projects to be imported into projects using the Android NDK build system. Closes: #15562
12 lines
396 B
CMake
12 lines
396 B
CMake
project(build)
|
|
set(CMAKE_BUILD_TYPE Debug)
|
|
add_library(foo foo.cxx)
|
|
add_library(car foo.cxx)
|
|
add_library(bar foo.cxx)
|
|
add_library(dog foo.cxx)
|
|
target_link_libraries(foo car bar dog debug -lm)
|
|
export(TARGETS bar dog car foo ANDROID_MK
|
|
${build_BINARY_DIR}/Android.mk)
|
|
install(TARGETS bar dog car foo DESTINATION lib EXPORT myexp)
|
|
install(EXPORT_ANDROID_MK myexp DESTINATION share/ndk-modules)
|