Просмотр исходного кода

Merge topic 'file-set-file-api'

b3e9fb67bb file-api: support exporting file set information

Acked-by: Kitware Robot <[email protected]>
Acked-by: buildbot <[email protected]>
Merge-request: !7867
Brad King 3 лет назад
Родитель
Сommit
16cb04dbe9
58 измененных файлов с 342 добавлено и 11 удалено
  1. 29 1
      Help/manual/cmake-file-api.7.rst
  2. 9 0
      Help/release/dev/file-api-file-sets.rst
  3. 1 1
      Source/cmFileAPI.cxx
  4. 104 7
      Source/cmFileAPICodemodel.cxx
  5. 1 1
      Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
  6. 30 1
      Tests/RunCMake/FileAPI/codemodel-v2-check.py
  7. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json
  8. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json
  9. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json
  10. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json
  11. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json
  12. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_interface.json
  13. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json
  14. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
  15. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json
  16. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json
  17. 31 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json
  18. 9 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json
  19. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json
  20. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json
  21. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json
  22. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json
  23. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json
  24. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json
  25. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json
  26. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json
  27. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json
  28. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json
  29. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json
  30. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json
  31. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json
  32. 5 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json
  33. 6 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json
  34. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json
  35. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json
  36. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json
  37. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json
  38. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json
  39. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json
  40. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json
  41. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json
  42. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json
  43. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json
  44. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_srcs.json
  45. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json
  46. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json
  47. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json
  48. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json
  49. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json
  50. 2 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json
  51. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json
  52. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json
  53. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json
  54. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json
  55. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json
  56. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_interface.json
  57. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_object.json
  58. 3 0
      Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_top.json

+ 29 - 1
Help/manual/cmake-file-api.7.rst

@@ -425,7 +425,7 @@ Version 1 does not exist to avoid confusion with that from
 
   {
     "kind": "codemodel",
-    "version": { "major": 2, "minor": 4 },
+    "version": { "major": 2, "minor": 5 },
     "paths": {
       "source": "/path/to/top-level-source-dir",
       "build": "/path/to/top-level-build-dir"
@@ -1071,6 +1071,27 @@ with members:
     available.  The value is an unsigned integer 0-based index into
     the ``backtraceGraph`` member's ``nodes`` array.
 
+``fileSets``
+  A JSON array of entries corresponding to the target's file sets. Each entry
+  is a JSON object with members:
+
+  ``name``
+    A string specifying the name of the file set.
+
+  ``type``
+    A string specifying the type of the file set.  See
+    :command:`target_sources` supported file set types.
+
+  ``visibility``
+    A string specifying the visibility of the file set; one of ``PUBLIC``,
+    ``PRIVATE``, or ``INTERFACE``.
+
+  ``baseDirectories``
+    A JSON array of strings specifying the base directories containing sources
+    in the file set.
+
+  This field was added in codemodel version 2.5.
+
 ``sources``
   A JSON array of entries corresponding to the target's source files.
   Each entry is a JSON object with members:
@@ -1096,6 +1117,13 @@ with members:
     Optional member that is present with boolean value ``true`` if
     the source is :prop_sf:`GENERATED`.
 
+  ``fileSetIndex``
+    Optional member that is present when the source is part of a file set.
+    The value is an unsigned integer 0-based index into the ``fileSets``
+    array.
+
+    This field was added in codemodel version 2.5.
+
   ``backtrace``
     Optional member that is present when a CMake language backtrace to
     the :command:`target_sources`, :command:`add_executable`,

+ 9 - 0
Help/release/dev/file-api-file-sets.rst

@@ -0,0 +1,9 @@
+file-api-file-sets
+------------------
+
+* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has
+  been updated to 2.5.
+
+* The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object
+  gained a new ``fileSets`` field and associated ``fileSetIndex``
+  field to ``sources`` objects.

+ 1 - 1
Source/cmFileAPI.cxx

@@ -687,7 +687,7 @@ std::string cmFileAPI::NoSupportedVersion(
 // The "codemodel" object kind.
 
 // Update Help/manual/cmake-file-api.7.rst when updating this constant.
-static unsigned int const CodeModelV2Minor = 4;
+static unsigned int const CodeModelV2Minor = 5;
 
 void cmFileAPI::BuildClientRequestCodeModel(
   ClientRequest& r, std::vector<RequestVersion> const& versions)

+ 104 - 7
Source/cmFileAPICodemodel.cxx

@@ -17,6 +17,7 @@
 
 #include <cm/string_view>
 #include <cmext/algorithm>
+#include <cmext/string_view>
 
 #include <cm3p/json/value.h>
 
@@ -44,6 +45,7 @@
 #include "cmListFileCache.h"
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
+#include "cmMessageType.h"
 #include "cmSourceFile.h"
 #include "cmSourceGroup.h"
 #include "cmState.h"
@@ -434,6 +436,8 @@ class Target
   std::unordered_map<CompileData, Json::ArrayIndex> CompileGroupMap;
   std::vector<CompileGroup> CompileGroups;
 
+  using FileSetDatabase = std::map<std::string, Json::ArrayIndex>;
+
   template <typename T>
   JBT<T> ToJBT(BT<T> const& bt)
   {
@@ -466,9 +470,12 @@ class Target
   Json::Value DumpPrecompileHeader(JBT<std::string> const& header);
   Json::Value DumpLanguageStandard(JBTs<std::string> const& standard);
   Json::Value DumpDefine(JBT<std::string> const& def);
-  Json::Value DumpSources();
+  std::pair<Json::Value, FileSetDatabase> DumpFileSets();
+  Json::Value DumpFileSet(cmFileSet const* fs,
+                          std::vector<std::string> const& directories);
+  Json::Value DumpSources(FileSetDatabase const& fsdb);
   Json::Value DumpSource(cmGeneratorTarget::SourceAndKind const& sk,
-                         Json::ArrayIndex si);
+                         Json::ArrayIndex si, FileSetDatabase const& fsdb);
   Json::Value DumpSourceGroups();
   Json::Value DumpSourceGroup(SourceGroup& sg);
   Json::Value DumpCompileGroups();
@@ -1216,7 +1223,13 @@ Json::Value Target::Dump()
   {
     this->ProcessLanguages();
 
-    target["sources"] = this->DumpSources();
+    auto fileSetInfo = this->DumpFileSets();
+
+    if (!fileSetInfo.first.isNull()) {
+      target["fileSets"] = fileSetInfo.first;
+    }
+
+    target["sources"] = this->DumpSources(fileSetInfo.second);
 
     Json::Value folder = this->DumpFolder();
     if (!folder.isNull()) {
@@ -1527,29 +1540,113 @@ Json::Value Target::DumpPaths()
   return paths;
 }
 
-Json::Value Target::DumpSources()
+std::pair<Json::Value, Target::FileSetDatabase> Target::DumpFileSets()
+{
+  Json::Value fsJson = Json::nullValue;
+  FileSetDatabase fsdb;
+
+  // Build the fileset database.
+  auto const* tgt = this->GT->Target;
+  auto const& fs_names = tgt->GetAllFileSetNames();
+
+  if (!fs_names.empty()) {
+    fsJson = Json::arrayValue;
+    size_t fsIndex = 0;
+    for (auto const& fs_name : fs_names) {
+      auto const* fs = tgt->GetFileSet(fs_name);
+      if (!fs) {
+        this->GT->Makefile->IssueMessage(
+          MessageType::INTERNAL_ERROR,
+          cmStrCat("Target \"", tgt->GetName(),
+                   "\" is tracked to have file set \"", fs_name,
+                   "\", but it was not found."));
+        continue;
+      }
+
+      auto fileEntries = fs->CompileFileEntries();
+      auto directoryEntries = fs->CompileDirectoryEntries();
+
+      auto directories = fs->EvaluateDirectoryEntries(
+        directoryEntries, this->GT->LocalGenerator, this->Config, this->GT);
+
+      fsJson.append(this->DumpFileSet(fs, directories));
+
+      std::map<std::string, std::vector<std::string>> files_per_dirs;
+      for (auto const& entry : fileEntries) {
+        fs->EvaluateFileEntry(directories, files_per_dirs, entry,
+                              this->GT->LocalGenerator, this->Config,
+                              this->GT);
+      }
+
+      for (auto const& files_per_dir : files_per_dirs) {
+        auto const& dir = files_per_dir.first;
+        for (auto const& file : files_per_dir.second) {
+          std::string sf_path;
+          if (dir.empty()) {
+            sf_path = file;
+          } else {
+            sf_path = cmStrCat(dir, '/', file);
+          }
+          fsdb[sf_path] = static_cast<Json::ArrayIndex>(fsIndex);
+        }
+      }
+
+      ++fsIndex;
+    }
+  }
+
+  return std::make_pair(fsJson, fsdb);
+}
+
+Json::Value Target::DumpFileSet(cmFileSet const* fs,
+                                std::vector<std::string> const& directories)
+{
+  Json::Value fileSet = Json::objectValue;
+
+  fileSet["name"] = fs->GetName();
+  fileSet["type"] = fs->GetType();
+  fileSet["visibility"] =
+    std::string(cmFileSetVisibilityToName(fs->GetVisibility()));
+
+  Json::Value baseDirs = Json::arrayValue;
+  for (auto const& directory : directories) {
+    baseDirs.append(directory);
+  }
+  fileSet["baseDirectories"] = baseDirs;
+
+  return fileSet;
+}
+
+Json::Value Target::DumpSources(FileSetDatabase const& fsdb)
 {
   Json::Value sources = Json::arrayValue;
   cmGeneratorTarget::KindedSources const& kinded =
     this->GT->GetKindedSources(this->Config);
   for (cmGeneratorTarget::SourceAndKind const& sk : kinded.Sources) {
-    sources.append(this->DumpSource(sk, sources.size()));
+    sources.append(this->DumpSource(sk, sources.size(), fsdb));
   }
   return sources;
 }
 
 Json::Value Target::DumpSource(cmGeneratorTarget::SourceAndKind const& sk,
-                               Json::ArrayIndex si)
+                               Json::ArrayIndex si,
+                               FileSetDatabase const& fsdb)
 {
   Json::Value source = Json::objectValue;
 
-  std::string const path = sk.Source.Value->ResolveFullPath();
+  cmSourceFile* sf = sk.Source.Value;
+  std::string const path = sf->ResolveFullPath();
   source["path"] = RelativeIfUnder(this->TopSource, path);
   if (sk.Source.Value->GetIsGenerated()) {
     source["isGenerated"] = true;
   }
   this->AddBacktrace(source, sk.Source.Backtrace);
 
+  auto fsit = fsdb.find(path);
+  if (fsit != fsdb.end()) {
+    source["fileSetIndex"] = fsit->second;
+  }
+
   if (cmSourceGroup* sg =
         this->GT->Makefile->FindSourceGroup(path, this->SourceGroupsLocal)) {
     source["sourceGroupIndex"] = this->AddSourceGroup(sg, si);

+ 1 - 1
Tests/RunCMake/CommandLine/E_capabilities-stdout.txt

@@ -1 +1 @@
-^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":4}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$
+^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":5}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$

+ 30 - 1
Tests/RunCMake/FileAPI/codemodel-v2-check.py

@@ -12,7 +12,7 @@ def read_codemodel_json_data(filename):
 def check_objects(o, g):
     assert is_list(o)
     assert len(o) == 1
-    check_index_object(o[0], "codemodel", 2, 4, check_object_codemodel(g))
+    check_index_object(o[0], "codemodel", 2, 5, check_object_codemodel(g))
 
 def check_backtrace(t, b, backtrace):
     btg = t["backtraceGraph"]
@@ -291,10 +291,30 @@ def check_target(c):
         assert matches(obj["paths"]["build"], expected["build"])
         assert matches(obj["paths"]["source"], expected["source"])
 
+        def check_file_set(actual, expected):
+            assert is_dict(actual)
+            expected_keys = ["name", "type", "visibility", "baseDirectories"]
+
+            assert is_string(actual["name"], expected["name"])
+            assert is_string(actual["type"], expected["type"])
+            assert is_string(actual["visibility"], expected["visibility"])
+
+            check_list_match(lambda a, e: matches(a, e), actual["baseDirectories"],
+                             expected["baseDirectories"],
+                             check_exception=lambda a, e: "File set base directory (check): %s" % a,
+                             missing_exception=lambda e: "File set base directory (missing): %s" % e,
+                             extra_exception=lambda a: "File set base directory (extra): %s" % a)
+
+            assert sorted(actual.keys()) == sorted(expected_keys)
+
         def check_source(actual, expected):
             assert is_dict(actual)
             expected_keys = ["path"]
 
+            if expected["fileSetName"] is not None:
+                expected_keys.append("fileSetIndex")
+                assert is_string(obj["fileSets"][actual["fileSetIndex"]]["name"], expected["fileSetName"])
+
             if expected["compileGroupLanguage"] is not None:
                 expected_keys.append("compileGroupIndex")
                 assert is_string(obj["compileGroups"][actual["compileGroupIndex"]]["language"], expected["compileGroupLanguage"])
@@ -313,6 +333,14 @@ def check_target(c):
 
             assert sorted(actual.keys()) == sorted(expected_keys)
 
+        if expected["fileSets"] is not None:
+            expected_keys.append("fileSets")
+            check_list_match(lambda a, e: matches(a["name"], e["name"]), obj["fileSets"],
+                             expected["fileSets"], check=check_file_set,
+                             check_exception=lambda a, e: "File set: %s" % a["name"],
+                             missing_exception=lambda e: "File set: %s" % e["name"],
+                             extra_exception=lambda a: "File set: %s" % a["name"])
+
         check_list_match(lambda a, e: matches(a["path"], e["path"]), obj["sources"],
                          expected["sources"], check=check_source,
                          check_exception=lambda a, e: "Source file: %s" % a["path"],
@@ -824,6 +852,7 @@ def gen_check_targets(c, g, inSource):
                         {
                             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/([0-9a-f]+/)?generate\\.stamp\\.rule$",
                             "isGenerated": True,
+                            "fileSetName": None,
                             "sourceGroupName": "CMake Rules",
                             "compileGroupLanguage": None,
                             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json

@@ -5,10 +5,12 @@
     "projectName": "Alias",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json

@@ -5,10 +5,12 @@
     "projectName": "Custom",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json

@@ -5,10 +5,12 @@
     "projectName": "Cxx",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json

@@ -5,10 +5,12 @@
     "projectName": "External",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json

@@ -5,10 +5,12 @@
     "projectName": "Imported",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_interface.json

@@ -5,10 +5,12 @@
     "projectName": "Interface",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ALL_BUILD$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ALL_BUILD\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json

@@ -5,10 +5,12 @@
     "projectName": "Object",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json

@@ -5,10 +5,12 @@
     "projectName": "codemodel-v2",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Alias",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json

@@ -5,10 +5,12 @@
     "projectName": "codemodel-v2",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 31 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json

@@ -5,10 +5,37 @@
   "projectName": "codemodel-v2",
   "type": "STATIC_LIBRARY",
   "isGeneratorProvided": null,
+  "fileSets": [
+    {
+      "name": "HEADERS",
+      "type": "HEADERS",
+      "visibility": "PUBLIC",
+      "baseDirectories": [".*/Tests/RunCMake/FileAPI/fileset$"]
+    },
+    {
+      "name": "a",
+      "type": "HEADERS",
+      "visibility": "PRIVATE",
+      "baseDirectories": [".*/Tests/RunCMake/FileAPI/fileset$"]
+    },
+    {
+      "name": "b",
+      "type": "HEADERS",
+      "visibility": "PUBLIC",
+      "baseDirectories": [".*/Tests/RunCMake/FileAPI/fileset/dir$"]
+    },
+    {
+      "name": "c",
+      "type": "HEADERS",
+      "visibility": "INTERFACE",
+      "baseDirectories": [".*/Tests/RunCMake/FileAPI/fileset$"]
+    }
+  ],
   "sources": [
     {
       "path": "^fileset/empty\\.c$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Source Files",
       "compileGroupLanguage": "C",
       "backtrace": [
@@ -29,6 +56,7 @@
     {
       "path": "^fileset/error\\.c$",
       "isGenerated": null,
+      "fileSetName": "HEADERS",
       "sourceGroupName": "Header Files",
       "compileGroupLanguage": null,
       "backtrace": [
@@ -49,6 +77,7 @@
     {
       "path": "^fileset/other\\.c$",
       "isGenerated": null,
+      "fileSetName": "HEADERS",
       "sourceGroupName": "Source Files",
       "compileGroupLanguage": null,
       "backtrace": [
@@ -69,6 +98,7 @@
     {
       "path": "^fileset/h1\\.h$",
       "isGenerated": null,
+      "fileSetName": "a",
       "sourceGroupName": "Header Files",
       "compileGroupLanguage": null,
       "backtrace": [
@@ -89,6 +119,7 @@
     {
       "path": "^fileset/dir/h2\\.h$",
       "isGenerated": null,
+      "fileSetName": "b",
       "sourceGroupName": "Header Files",
       "compileGroupLanguage": null,
       "backtrace": [

+ 9 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json

@@ -5,10 +5,19 @@
   "projectName": "codemodel-v2",
   "type": "STATIC_LIBRARY",
   "isGeneratorProvided": null,
+  "fileSets": [
+    {
+      "name": "HEADERS",
+      "type": "HEADERS",
+      "visibility": "INTERFACE",
+      "baseDirectories": [".*/Tests/RunCMake/FileAPI/fileset$"]
+    }
+  ],
   "sources": [
     {
       "path": "^fileset/empty\\.c$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Source Files",
       "compileGroupLanguage": "C",
       "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json

@@ -5,10 +5,12 @@
     "projectName": "codemodel-v2",
     "type": "STATIC_LIBRARY",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Object",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [
@@ -29,6 +31,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(object|build/c_object_lib\\.build)/.*/empty(\\.c)?\\.o(bj)?$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "Object Libraries",
             "compileGroupLanguage": null,
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json

@@ -5,10 +5,12 @@
     "projectName": "Object",
     "type": "OBJECT_LIBRARY",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json

@@ -5,10 +5,12 @@
     "projectName": "codemodel-v2",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json

@@ -5,10 +5,12 @@
     "projectName": "codemodel-v2",
     "type": "SHARED_LIBRARY",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json

@@ -5,10 +5,12 @@
     "projectName": "codemodel-v2",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json

@@ -5,10 +5,12 @@
     "projectName": "codemodel-v2",
     "type": "STATIC_LIBRARY",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_subdir.json

@@ -5,10 +5,12 @@
     "projectName": "codemodel-v2",
     "type": "STATIC_LIBRARY",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^subdir/empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Custom",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json

@@ -5,10 +5,12 @@
     "projectName": "Custom",
     "type": "UTILITY",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt(-(Debug|Release|RelWithDebInfo|MinSizeRel))?$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -29,6 +31,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt(-\\(CONFIG\\))?\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Alias",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.cxx$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "CXX",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Cxx",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.cxx$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "CXX",
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json

@@ -97,6 +97,7 @@
     {
       "path": ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Source Files",
       "compileGroupLanguage": "CXX",
       "backtrace": [
@@ -111,6 +112,7 @@
     {
       "path": "^empty\\.cxx$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Source Files",
       "compileGroupLanguage": "CXX",
       "backtrace": [
@@ -131,6 +133,7 @@
     {
       "path": ".*/cmake_pch(_[^.]+)?\\.hxx$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Precompile Header File",
       "compileGroupLanguage": null,
       "backtrace": [

+ 5 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json

@@ -143,6 +143,7 @@
     {
       "path": ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Source Files",
       "compileGroupLanguage": "CXX",
       "backtrace": [
@@ -157,6 +158,7 @@
     {
       "path": ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Source Files",
       "compileGroupLanguage": "CXX",
       "backtrace": [
@@ -171,6 +173,7 @@
     {
       "path": "^empty\\.cxx$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Source Files",
       "compileGroupLanguage": "CXX",
       "backtrace": [
@@ -191,6 +194,7 @@
     {
       "path": ".*/cmake_pch(_[^.]+)?\\.hxx$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Precompile Header File",
       "compileGroupLanguage": null,
       "backtrace": [
@@ -205,6 +209,7 @@
     {
       "path": ".*/cmake_pch(_[^.]+)?\\.hxx$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Precompile Header File",
       "compileGroupLanguage": null,
       "backtrace": [

+ 6 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json

@@ -97,6 +97,7 @@
     {
       "path": ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Source Files",
       "compileGroupLanguage": "CXX",
       "backtrace": [
@@ -111,6 +112,7 @@
     {
       "path": "^empty\\.cxx$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Source Files",
       "compileGroupLanguage": "CXX",
       "backtrace": [
@@ -131,6 +133,7 @@
     {
       "path": ".*/Debug/cmake_pch(_[^.]+)?\\.hxx$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Precompile Header File",
       "compileGroupLanguage": null,
       "backtrace": [
@@ -145,6 +148,7 @@
     {
       "path": ".*/Release/cmake_pch(_[^.]+)?\\.hxx$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Precompile Header File",
       "compileGroupLanguage": null,
       "backtrace": [
@@ -159,6 +163,7 @@
     {
       "path": ".*/MinSizeRel/cmake_pch(_[^.]+)?\\.hxx$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Precompile Header File",
       "compileGroupLanguage": null,
       "backtrace": [
@@ -173,6 +178,7 @@
     {
       "path": ".*/RelWithDebInfo/cmake_pch(_[^.]+)?\\.hxx$",
       "isGenerated": null,
+      "fileSetName": null,
       "sourceGroupName": "Precompile Header File",
       "compileGroupLanguage": null,
       "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json

@@ -5,10 +5,12 @@
     "projectName": "Cxx",
     "type": "STATIC_LIBRARY",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.cxx$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "CXX",
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Object",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.cxx$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "CXX",
             "backtrace": [
@@ -29,6 +31,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(object|build/cxx_object_lib\\.build)/.*/empty(\\.cxx)?\\.o(bj)?$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "Object Libraries",
             "compileGroupLanguage": null,
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json

@@ -5,10 +5,12 @@
     "projectName": "Object",
     "type": "OBJECT_LIBRARY",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.cxx$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "CXX",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Cxx",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.cxx$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "CXX",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json

@@ -5,10 +5,12 @@
     "projectName": "Cxx",
     "type": "SHARED_LIBRARY",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.cxx$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "CXX",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_compile_feature_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Cxx",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.cxx$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "CXX",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_standard_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Cxx",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.cxx$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "CXX",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Cxx",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.cxx$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "CXX",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json

@@ -5,10 +5,12 @@
     "projectName": "Cxx",
     "type": "STATIC_LIBRARY",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.cxx$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "CXX",
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json

@@ -5,10 +5,12 @@
     "projectName": "External",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [
@@ -29,6 +31,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "Generated Source Files",
             "compileGroupLanguage": "CXX",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/iface_srcs.json

@@ -5,10 +5,12 @@
     "projectName": "Interface",
     "type": "INTERFACE_LIBRARY",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": null,
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json

@@ -5,10 +5,12 @@
     "projectName": "codemodel-v2",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Imported",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Imported",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Imported",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Imported",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json

@@ -5,10 +5,12 @@
     "projectName": "Imported",
     "type": "EXECUTABLE",
     "isGeneratorProvided": null,
+    "fileSets": null,
     "sources": [
         {
             "path": "^empty\\.c$",
             "isGenerated": null,
+            "fileSetName": null,
             "sourceGroupName": "Source Files",
             "compileGroupLanguage": "C",
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json

@@ -5,10 +5,12 @@
     "projectName": "Alias",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json

@@ -5,10 +5,12 @@
     "projectName": "Custom",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json

@@ -5,10 +5,12 @@
     "projectName": "Cxx",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json

@@ -5,10 +5,12 @@
     "projectName": "External",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json

@@ -5,10 +5,12 @@
     "projectName": "Imported",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_interface.json

@@ -5,10 +5,12 @@
     "projectName": "Interface",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ZERO_CHECK$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/interface/CMakeFiles/ZERO_CHECK\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_object.json

@@ -5,10 +5,12 @@
     "projectName": "Object",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [

+ 3 - 0
Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_top.json

@@ -5,10 +5,12 @@
     "projectName": "codemodel-v2",
     "type": "UTILITY",
     "isGeneratorProvided": true,
+    "fileSets": null,
     "sources": [
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "",
             "compileGroupLanguage": null,
             "backtrace": [
@@ -23,6 +25,7 @@
         {
             "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$",
             "isGenerated": true,
+            "fileSetName": null,
             "sourceGroupName": "CMake Rules",
             "compileGroupLanguage": null,
             "backtrace": [