Merge topic 'file-api-fileset-fix' into release-4.1

ea6404b9c4 FileAPI: Ignore unresolved FileSet generators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: autoantwort <leander.schulten@rwth-aachen.de>
Merge-request: !10938
This commit is contained in:
Brad King
2025-07-10 14:28:34 +00:00
committed by Kitware Robot
4 changed files with 12 additions and 3 deletions

View File

@@ -1068,10 +1068,16 @@ Json::Value DirectoryObject::DumpInstaller(cmInstallGenerator* gen)
}
} else if (auto* installFileSet =
dynamic_cast<cmInstallFileSetGenerator*>(gen)) {
auto const* fileSet = installFileSet->GetFileSet();
// No fileSet by that name exists for the associated target
if (!fileSet) {
return installer;
}
installer["type"] = "fileSet";
installer["destination"] = installFileSet->GetDestination(this->Config);
auto const* fileSet = installFileSet->GetFileSet();
auto* target = installFileSet->GetTarget();
auto dirCges = fileSet->CompileDirectoryEntries();

View File

@@ -187,7 +187,7 @@
"backtrace": [
{
"file": "^fileset/CMakeLists\\.txt$",
"line": 25,
"line": 28,
"command": "install",
"hasParent": true
},

View File

@@ -88,7 +88,7 @@
"backtrace": [
{
"file": "^fileset/CMakeLists\\.txt$",
"line": 25,
"line": 28,
"command": "install",
"hasParent": true
},

View File

@@ -21,5 +21,8 @@ install(TARGETS c_headers_1
FILE_SET HEADERS DESTINATION include COMPONENT Headers
FILE_SET b DESTINATION include/dir
FILE_SET c
# Non-extant FILE_SET should be ignored
FILE_SET d
)
install(TARGETS c_headers_2)