|
|
@@ -112,7 +112,7 @@ bool cmExportInstallPackageInfoGenerator::GenerateMainFile(std::ostream& os)
|
|
|
|
|
|
// Set configuration-agnostic properties for component.
|
|
|
this->GenerateInterfaceProperties(*component, gt, properties);
|
|
|
- if (!this->GenerateFileSetProperties(*component, gt, te)) {
|
|
|
+ if (!this->GenerateFileSetProperties(*component, gt, te, packagePath)) {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
@@ -143,6 +143,8 @@ void cmExportInstallPackageInfoGenerator::GenerateImportTargetsConfig(
|
|
|
root["name"] = this->GetPackageName();
|
|
|
root["configuration"] = (config.empty() ? "noconfig" : config);
|
|
|
|
|
|
+ std::string const& packagePath = this->GenerateImportPrefix();
|
|
|
+
|
|
|
Json::Value& components = root["components"];
|
|
|
|
|
|
for (auto const& te : this->GetExportSet()->GetTargetExports()) {
|
|
|
@@ -158,7 +160,8 @@ void cmExportInstallPackageInfoGenerator::GenerateImportTargetsConfig(
|
|
|
|
|
|
Json::Value component =
|
|
|
this->GenerateInterfaceConfigProperties(suffix, properties);
|
|
|
- this->GenerateFileSetProperties(component, te->Target, te.get(), config);
|
|
|
+ this->GenerateFileSetProperties(component, te->Target, te.get(),
|
|
|
+ packagePath, config);
|
|
|
|
|
|
if (!component.empty()) {
|
|
|
components[te->Target->GetExportName()] = std::move(component);
|
|
|
@@ -212,10 +215,7 @@ std::string cmExportInstallPackageInfoGenerator::InstallNameDir(
|
|
|
|
|
|
std::string cmExportInstallPackageInfoGenerator::GetCxxModulesDirectory() const
|
|
|
{
|
|
|
- // TODO: Implement a not-CMake-specific mechanism for providing module
|
|
|
- // information.
|
|
|
- // return IEGen->GetCxxModuleDirectory();
|
|
|
- return {};
|
|
|
+ return IEGen->GetCxxModuleDirectory();
|
|
|
}
|
|
|
|
|
|
cm::optional<std::string>
|
|
|
@@ -265,8 +265,9 @@ cmExportInstallPackageInfoGenerator::GetFileSetDirectory(
|
|
|
|
|
|
bool cmExportInstallPackageInfoGenerator::GenerateFileSetProperties(
|
|
|
Json::Value& component, cmGeneratorTarget* gte, cmTargetExport const* te,
|
|
|
- cm::optional<std::string> config)
|
|
|
+ std::string const& packagePath, cm::optional<std::string> config)
|
|
|
{
|
|
|
+ bool hasModules = false;
|
|
|
std::set<std::string> seenIncludeDirectories;
|
|
|
for (auto const& name : gte->Target->GetAllInterfaceFileSets()) {
|
|
|
cmFileSet* fileSet = gte->Target->GetFileSet(name);
|
|
|
@@ -290,9 +291,18 @@ bool cmExportInstallPackageInfoGenerator::GenerateFileSetProperties(
|
|
|
seenIncludeDirectories.insert(*fileSetDirectory);
|
|
|
}
|
|
|
} else if (fileSet->GetType() == "CXX_MODULES"_s) {
|
|
|
- /* TODO: Handle the CXX_MODULE directory */
|
|
|
+ hasModules = true;
|
|
|
+ this->RequiresConfigFiles = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (hasModules && config) {
|
|
|
+ std::string const manifestPath =
|
|
|
+ this->GenerateCxxModules(component, gte, packagePath, *config);
|
|
|
+ if (!manifestPath.empty()) {
|
|
|
+ this->ConfigCxxModuleFiles[*config] =
|
|
|
+ cmStrCat(this->FileDir, '/', manifestPath);
|
|
|
+ }
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|