Notes |
|
(0039358)
|
Gregor Jasny
|
2015-08-31 08:08
|
|
I have a function for this available:
.. command:: generate_android_mk
Generates an Android.mk file for a target. If APPEND is set the target is appended to the
file. That way you can make multiple calls to generate_android_mk for one single file.
This file could be used by the Android NDK build system. Usage::
generate_android_mk(TARGET <target> FILE <output> [APPEND]
[CPPFLAGS <flag1> ...]
[LIBRARIES <lib1> ...])
Example::
generate_android_mk(
FILE "${MY_ANDROID_MK}"
TARGET mylib
LIBRARIES boost_chrono-gcc-mt boost_date_time-gcc-mt boost_thread-gcc-mt boost_system-gcc-mt
CPPFLAGS -frtti)
install(FILES "${MY_ANDROID_MK}" DESTINATION "/")
I will polish it within the next two weeks. |
|
|
(0039359)
|
Gregor Jasny
|
2015-08-31 08:14
|
|
I think I misread your request. What do you want to achieve? Compiling some libraries with the help of CMake or make a CMake generated library consumable by plain Android NDK? |
|
|
(0039649)
|
John Anderson
|
2015-10-19 17:37
|
|
Any news on this? I'm hoping to see a generator that outputs Android.mk files to be consumed by ndk-build. |
|
|
(0039652)
|
Ben Boeckel
|
2015-10-19 18:17
|
|
That is unlikely. The NDK would need to document and stabilize internal semantics related to the Android.mk files. For example, how does CMake add/remove -fPIC? Change the output name of a library? The soversion? How to get ndk-build to rerun CMake when the relevant CMake files change? The ndk-build tool also (AFAIK) uses a strict directory format whereas CMake tends to mirror the source tree layout.
All of these things can probably be done by setting internal variables used by the NDK, but it is also easily broken by even minor NDK bumps.
I think the best way to do it is have CMake build your libraries, drop them in a directory for the NDK to use and then have a target which runs ndk-build. |
|
|
(0039653)
|
Brad King
|
2015-10-20 08:22
|
|
Another possibility is to have the export() and install(EXPORT) commands support generating Android.mk files that import the results of a CMake-based build into the NDK build as prebuilt binaries. |
|
|
(0042775)
|
Kitware Robot
|
2016-06-10 14:29
|
|
Resolving issue as `moved`.
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page. |
|