View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015562CMakeCMakepublic2015-05-11 01:322016-06-10 14:31
ReporterGopi Krishnan 
Assigned ToKitware Robot 
PriorityhighSeveritymajorReproducibilityunable to reproduce
StatusclosedResolutionmoved 
PlatformAndroidOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0015562: Generate the Android Make file
DescriptionI am Having C/C++ source file and trying to generate the Android Make file. But in Cmake tool seems it is not available .

It is Possible to generate the Android Makefile for my C/C++ source.

TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0039358)
Gregor Jasny (developer)
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 (developer)
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 (reporter)
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 (developer)
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 (manager)
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 (administrator)
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.

 Issue History
Date Modified Username Field Change
2015-05-11 01:32 Gopi Krishnan New Issue
2015-08-31 08:08 Gregor Jasny Note Added: 0039358
2015-08-31 08:11 Gregor Jasny Assigned To => Gregor Jasny
2015-08-31 08:11 Gregor Jasny Status new => assigned
2015-08-31 08:12 Gregor Jasny Assigned To Gregor Jasny =>
2015-08-31 08:14 Gregor Jasny Note Added: 0039359
2015-10-19 17:37 John Anderson Note Added: 0039649
2015-10-19 18:17 Ben Boeckel Note Added: 0039652
2015-10-20 08:22 Brad King Note Added: 0039653
2016-06-10 14:29 Kitware Robot Note Added: 0042775
2016-06-10 14:29 Kitware Robot Status assigned => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team