install(EXPORT_ANDROID_MK): Record COMPONENT in global COMPONENTS list

Issue: #27249
This commit is contained in:
F. Pichot
2025-09-22 14:53:04 +08:00
committed by Brad King
parent abfc07f91f
commit 5e7f21328c
3 changed files with 9 additions and 1 deletions

View File

@@ -2014,6 +2014,11 @@ bool HandleExportAndroidMKMode(std::vector<std::string> const& args,
cmInstallGenerator::MessageLevel message =
cmInstallGenerator::SelectMessageLevel(helper.Makefile);
// Tell the global generator about any installation component names
// specified
helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
ica.GetComponent());
// Create the export install generator.
helper.Makefile->AddInstallGenerator(
cm::make_unique<cmInstallAndroidMKExportGenerator>(

View File

@@ -0,0 +1 @@
-- COMPONENTS='Unspecified;android'

View File

@@ -10,4 +10,6 @@ target_link_options(foo2 INTERFACE -lm)
export(TARGETS bar dog car foo foo2 ANDROID_MK
${build_BINARY_DIR}/Android.mk)
install(TARGETS bar dog car foo foo2 DESTINATION lib EXPORT myexp)
install(EXPORT_ANDROID_MK myexp DESTINATION share/ndk-modules)
install(EXPORT_ANDROID_MK myexp DESTINATION share/ndk-modules COMPONENT android)
get_cmake_property(components COMPONENTS)
message(STATUS "COMPONENTS='${components}'")