mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 15:20:56 -06:00
install(EXPORT): Fall back to set_property(APPEND) for FILE_SET
FILE_SET was introduced in CMake 3.23, so install(EXPORT) puts it behind a version gate. However, this results in the include directories not being picked up by older versions of CMake. Fall back to set_property(APPEND) for versions of CMake older than 3.23. Fixes: #24787
This commit is contained in:
@@ -1309,7 +1309,22 @@ void cmExportFileGenerator::GenerateTargetFileSets(cmGeneratorTarget* gte,
|
||||
<< this->GetFileSetFiles(gte, fileSet, te) << "\n";
|
||||
}
|
||||
|
||||
os << " )\nendif()\n\n";
|
||||
os << " )\nelse()\n set_property(TARGET " << targetName
|
||||
<< "\n APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES";
|
||||
for (auto const& name : interfaceFileSets) {
|
||||
auto* fileSet = gte->Target->GetFileSet(name);
|
||||
if (!fileSet) {
|
||||
gte->Makefile->IssueMessage(
|
||||
MessageType::FATAL_ERROR,
|
||||
cmStrCat("File set \"", name,
|
||||
"\" is listed in interface file sets of ", gte->GetName(),
|
||||
" but has not been created"));
|
||||
return;
|
||||
}
|
||||
|
||||
os << "\n " << this->GetFileSetDirectories(gte, fileSet, te);
|
||||
}
|
||||
os << "\n )\nendif()\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user