summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallExportGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2016-07-12 17:26:55 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-13 16:47:43 (GMT)
commit42ce9f1e7178b3535726c0c885cc7c9f760cc8b6 (patch)
tree6ebd228d18eb0b08ff2d950900574dd29caad95d /Source/cmInstallExportGenerator.cxx
parentd5257063b04a95aca3d144f860698a3c7181e554 (diff)
downloadCMake-42ce9f1e7178b3535726c0c885cc7c9f760cc8b6.zip
CMake-42ce9f1e7178b3535726c0c885cc7c9f760cc8b6.tar.gz
CMake-42ce9f1e7178b3535726c0c885cc7c9f760cc8b6.tar.bz2
Add support for creating prebuilt Android.mk files
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
Diffstat (limited to 'Source/cmInstallExportGenerator.cxx')
-rw-r--r--Source/cmInstallExportGenerator.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index 27628f4..5ea7faf 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -16,6 +16,9 @@
#include <sstream>
#include <utility>
+#ifdef CMAKE_BUILD_WITH_CMAKE
+#include "cmExportInstallAndroidMKGenerator.h"
+#endif
#include "cmExportInstallFileGenerator.h"
#include "cmExportSet.h"
#include "cmInstallType.h"
@@ -27,7 +30,7 @@ cmInstallExportGenerator::cmInstallExportGenerator(
cmExportSet* exportSet, const char* destination,
const char* file_permissions, std::vector<std::string> const& configurations,
const char* component, MessageLevel message, bool exclude_from_all,
- const char* filename, const char* name_space, bool exportOld)
+ const char* filename, const char* name_space, bool exportOld, bool android)
: cmInstallGenerator(destination, configurations, component, message,
exclude_from_all)
, ExportSet(exportSet)
@@ -37,7 +40,13 @@ cmInstallExportGenerator::cmInstallExportGenerator(
, ExportOld(exportOld)
, LocalGenerator(CM_NULLPTR)
{
- this->EFGen = new cmExportInstallFileGenerator(this);
+ if (android) {
+#ifdef CMAKE_BUILD_WITH_CMAKE
+ this->EFGen = new cmExportInstallAndroidMKGenerator(this);
+#endif
+ } else {
+ this->EFGen = new cmExportInstallFileGenerator(this);
+ }
exportSet->AddInstallation(this);
}