Ver código fonte

file API: Add JSON schema files

Fixes: #26987
Craig Scott 4 meses atrás
pai
commit
aa63990ca9

+ 36 - 0
Help/manual/cmake-file-api.7.rst

@@ -125,6 +125,10 @@ query it writes to build trees to request newer object versions.
 This can be used to avoid asking CMake to generate multiple object
 versions unnecessarily.
 
+.. versionadded:: 4.1
+  The ``query.json`` file is described in machine-readable form by
+  :download:`this JSON schema </manual/file_api/schema_stateful_query.json>`.
+
 A ``query.json`` file must contain a JSON object:
 
 .. code-block:: json
@@ -200,6 +204,10 @@ time between these steps there may be multiple index files present;
 the one with the largest name in lexicographic order is the current
 index file.
 
+.. versionadded:: 4.1
+  The reply index file is described in machine-readable form by
+  :download:`this JSON schema </manual/file_api/schema_index.json>`.
+
 The reply index file contains a JSON object:
 
 .. code-block:: json
@@ -471,6 +479,10 @@ There is only one ``codemodel`` object major version, version 2.
 Version 1 does not exist to avoid confusion with that from
 :manual:`cmake-server(7)` mode.
 
+.. versionadded:: 4.1
+  The ``codemodel`` object kind reply is described in machine-readable form
+  by :download:`this JSON schema </manual/file_api/schema_codemodel.json>`.
+
 "codemodel" version 2
 ^^^^^^^^^^^^^^^^^^^^^
 
@@ -700,6 +712,10 @@ The members specific to ``codemodel`` objects are:
 "codemodel" version 2 "directory" object
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+.. versionadded:: 4.1
+  The ``directory`` object reply is described in machine-readable form by
+  :download:`this JSON schema </manual/file_api/schema_directory.json>`.
+
 A codemodel "directory" object is referenced by a `"codemodel" version 2`_
 object's ``directories`` array.  Each "directory" object is a JSON object
 with members:
@@ -989,6 +1005,10 @@ with members:
 "codemodel" version 2 "target" object
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+.. versionadded:: 4.1
+  The ``target`` object reply is described in machine-readable form by
+  :download:`this JSON schema </manual/file_api/schema_target.json>`.
+
 A codemodel "target" object is referenced by a `"codemodel" version 2`_
 object's ``targets`` array.  Each "target" object is a JSON object
 with members:
@@ -1497,6 +1517,10 @@ a :manual:`cmake-configure-log(7)` file.
 
 There is only one ``configureLog`` object major version, version 1.
 
+.. versionadded:: 4.1
+  The ``configureLog`` object kind reply is described in machine-readable form
+  by :download:`this JSON schema </manual/file_api/schema_configureLog.json>`.
+
 "configureLog" version 1
 ^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -1537,6 +1561,10 @@ There is only one ``cache`` object major version, version 2.
 Version 1 does not exist to avoid confusion with that from
 :manual:`cmake-server(7)` mode.
 
+.. versionadded:: 4.1
+  The ``cache`` object kind reply is described in machine-readable form by
+  :download:`this JSON schema </manual/file_api/schema_cache.json>`.
+
 "cache" version 2
 ^^^^^^^^^^^^^^^^^
 
@@ -1609,6 +1637,10 @@ configuring and generating the build system.  These include the
 
 There is only one ``cmakeFiles`` object major version, version 1.
 
+.. versionadded:: 4.1
+  The ``cmakeFiles`` object kind reply is described in machine-readable form
+  by :download:`this JSON schema </manual/file_api/schema_cmakeFiles.json>`.
+
 "cmakeFiles" version 1
 ^^^^^^^^^^^^^^^^^^^^^^
 
@@ -1738,6 +1770,10 @@ the build.  These include the language, compiler path, ID, and version.
 
 There is only one ``toolchains`` object major version, version 1.
 
+.. versionadded:: 4.1
+  The ``toolchains`` object kind reply is described in machine-readable form
+  by :download:`this JSON schema </manual/file_api/schema_toolchains.json>`.
+
 "toolchains" version 1
 ^^^^^^^^^^^^^^^^^^^^^^
 

+ 83 - 0
Help/manual/file_api/schema_cache.json

@@ -0,0 +1,83 @@
+{
+  "$schema": "http://json-schema.org/draft-07/schema#",
+  "description": "Schema for the CMake cache object kind",
+  "type": "object",
+  "required": [
+    "kind",
+    "version",
+    "entries"
+  ],
+  "properties": {
+    "kind": {
+      "type": "string",
+      "const": "cache"
+    },
+    "version": {
+      "type": "object",
+      "required": [
+        "major",
+        "minor"
+      ],
+      "properties": {
+        "major": {
+          "type": "integer",
+          "const": 2
+        },
+        "minor": {
+          "type": "integer",
+          "const": 0
+        }
+      },
+      "additionalProperties": false
+    },
+    "entries": {
+      "type": "array",
+      "description": "Array of CMake cache entries",
+      "items": {
+        "type": "object",
+        "required": [
+          "name",
+          "value",
+          "type",
+          "properties"
+        ],
+        "properties": {
+          "name": {
+            "type": "string",
+            "description": "Name of the cache entry"
+          },
+          "value": {
+            "type": "string",
+            "description": "Value of the cache entry"
+          },
+          "type": {
+            "type": "string",
+            "description": "Type of the cache entry used by CMake GUI to choose a widget for editing"
+          },
+          "properties": {
+            "type": "array",
+            "description": "Associated properties for the cache entry",
+            "items": {
+              "type": "object",
+              "required": [
+                "name",
+                "value"
+              ],
+              "properties": {
+                "name": {
+                  "type": "string"
+                },
+                "value": {
+                  "type": "string"
+                }
+              },
+              "additionalProperties": false
+            }
+          }
+        },
+        "additionalProperties": false
+      }
+    }
+  },
+  "additionalProperties": false
+}

+ 186 - 0
Help/manual/file_api/schema_cmakeFiles.json

@@ -0,0 +1,186 @@
+{
+  "$schema": "http://json-schema.org/draft-07/schema#",
+  "description": "Schema for the CMake cmakeFiles object kind",
+  "type": "object",
+  "required": [
+    "kind",
+    "version",
+    "paths",
+    "inputs"
+  ],
+  "oneOf": [
+    {
+      "$ref": "#/definitions/cmakeFilesV1_0"
+    },
+    {
+      "$ref": "#/definitions/cmakeFilesV1_1"
+    }
+  ],
+  "definitions": {
+    "kind": {
+      "type": "string",
+      "const": "cmakeFiles",
+      "description": "Specifies the object kind"
+    },
+    "versionV1_0": {
+      "type": "object",
+      "required": [
+        "major",
+        "minor"
+      ],
+      "properties": {
+        "major": {
+          "type": "integer",
+          "const": 1
+        },
+        "minor": {
+          "type": "integer",
+          "const": 0
+        }
+      },
+      "additionalProperties": false
+    },
+    "versionV1_1": {
+      "type": "object",
+      "required": [
+        "major",
+        "minor"
+      ],
+      "properties": {
+        "major": {
+          "type": "integer",
+          "const": 1
+        },
+        "minor": {
+          "type": "integer",
+          "const": 1
+        }
+      },
+      "additionalProperties": false
+    },
+    "paths": {
+      "type": "object",
+      "required": [
+        "build",
+        "source"
+      ],
+      "properties": {
+        "build": {
+          "type": "string",
+          "description": "Absolute path to the top-level build directory"
+        },
+        "source": {
+          "type": "string",
+          "description": "Absolute path to the top-level source directory"
+        }
+      },
+      "additionalProperties": false
+    },
+    "inputs": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "path"
+        ],
+        "properties": {
+          "path": {
+            "type": "string",
+            "description": "Path to an input file to CMake"
+          },
+          "isGenerated": {
+            "type": "boolean",
+            "description": "Indicates if the file is under the build directory in out-of-source builds"
+          },
+          "isExternal": {
+            "type": "boolean",
+            "description": "Indicates if the file is not under source or build directories"
+          },
+          "isCMake": {
+            "type": "boolean",
+            "description": "Indicates if the file is in the CMake installation"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "globsDependentV1_1": {
+      "type": "array",
+      "description": "Optional member present only when the project calls file(GLOB) or file(GLOB_RECURSE) with the CONFIGURE_DEPENDS option",
+      "items": {
+        "type": "object",
+        "required": [
+          "expression",
+          "paths"
+        ],
+        "properties": {
+          "expression": {
+            "type": "string",
+            "description": "The globbing expression. If the result of the expression no longer matches the same list of paths, the build system is considered out of date and the build tool will re-run cmake."
+          },
+          "recurse": {
+            "type": "boolean",
+            "description": "This will be true if the glob expression was from a file(GLOB_RECURSE) call"
+          },
+          "listDirectories": {
+            "type": "boolean",
+            "description": "This will be true if the expression is from a file(GLOB) that does not specify LIST_DIRECTORIES false, or from a file(GLOB_RECURSE) with LIST_DIRECTORIES set to true"
+          },
+          "followSymlinks": {
+            "type": "boolean",
+            "description": "This will be true if the FOLLOW_SYMLINKS option was given"
+          },
+          "relative": {
+            "type": "string",
+            "description": "This will be present if the RELATIVE option was given. The value is the path given after the RELATIVE keyword."
+          },
+          "paths": {
+            "type": "array",
+            "items": {
+              "type": "string"
+            },
+            "description": "Paths matched by the globbing expression"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "cmakeFilesV1_0": {
+      "properties": {
+        "kind": {
+          "$ref": "#/definitions/kind"
+        },
+        "version": {
+          "$ref": "#/definitions/versionV1_0"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "inputs": {
+          "$ref": "#/definitions/inputs"
+        }
+      },
+      "additionalProperties": false
+    },
+    "cmakeFilesV1_1": {
+      "properties": {
+        "kind": {
+          "$ref": "#/definitions/kind"
+        },
+        "version": {
+          "$ref": "#/definitions/versionV1_1"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "inputs": {
+          "$ref": "#/definitions/inputs"
+        },
+        "globsDependent": {
+          "$ref": "#/definitions/globsDependentV1_1"
+        }
+      },
+      "additionalProperties": false
+    }
+  }
+}

+ 390 - 0
Help/manual/file_api/schema_codemodel.json

@@ -0,0 +1,390 @@
+{
+  "$schema": "http://json-schema.org/draft-07/schema#",
+  "description": "Schema for the CMake codemodel object kind",
+  "type": "object",
+  "required": [
+    "kind",
+    "version",
+    "paths",
+    "configurations"
+  ],
+  "oneOf": [
+    {
+      "$ref": "#/definitions/codemodelV2_0"
+    },
+    {
+      "$ref": "#/definitions/codemodelV2_3"
+    }
+  ],
+  "definitions": {
+    "kind": {
+      "type": "string",
+      "const": "codemodel",
+      "description": "Specifies the object kind"
+    },
+    "versionV2_0": {
+      "type": "object",
+      "required": [
+        "major",
+        "minor"
+      ],
+      "properties": {
+        "major": {
+          "type": "integer",
+          "const": 2
+        },
+        "minor": {
+          "type": "integer",
+          "minimum": 0,
+          "maximum": 2
+        }
+      },
+      "additionalProperties": false
+    },
+    "versionV2_3": {
+      "type": "object",
+      "required": [
+        "major",
+        "minor"
+      ],
+      "properties": {
+        "major": {
+          "type": "integer",
+          "const": 2
+        },
+        "minor": {
+          "type": "integer",
+          "minimum": 3
+        }
+      },
+      "additionalProperties": false
+    },
+    "paths": {
+      "type": "object",
+      "required": [
+        "source",
+        "build"
+      ],
+      "properties": {
+        "source": {
+          "type": "string",
+          "description": "Absolute path to the top-level source directory"
+        },
+        "build": {
+          "type": "string",
+          "description": "Absolute path to the top-level build directory"
+        }
+      },
+      "additionalProperties": false
+    },
+    "configurationDirectoryItemSource": {
+      "type": "string",
+      "description": "Path to the source directory. If it is inside the top level source directory, the path will be relative to that directory. For the top level source directory, this will simply be '.'. Paths outside the top level source directory will be absolute."
+    },
+    "configurationDirectoryItemBuild": {
+      "type": "string",
+      "description": "Path to the build directory. If it is inside the top level build directory, the path will be relative to that directory. For the top level build directory, this will simply be '.'. Paths outside the top level build directory will be absolute."
+    },
+    "configurationDirectoryItemParentIndex": {
+      "type": "integer",
+      "minimum": 0,
+      "description": "Index of the parent directory in the directories array"
+    },
+    "configurationDirectoryItemChildIndexes": {
+      "type": "array",
+      "items": {
+        "type": "integer",
+        "minimum": 0
+      },
+      "description": "Indices of child directories"
+    },
+    "configurationDirectoryItemProjectIndex": {
+      "type": "integer",
+      "minimum": 0,
+      "description": "Index into the projects array"
+    },
+    "configurationDirectoryItemTargetIndexes": {
+      "type": "array",
+      "items": {
+        "type": "integer",
+        "minimum": 0
+      },
+      "description": "Indices into the targets array"
+    },
+    "configurationDirectoryItemMinimumCMakeVersion": {
+      "type": "object",
+      "required": [
+        "string"
+      ],
+      "properties": {
+        "string": {
+          "type": "string",
+          "description": "Minimum required CMake version, if known"
+        }
+      },
+      "additionalProperties": false
+    },
+    "configurationDirectoryItemHasInstallRule": {
+      "type": "boolean",
+      "description": "Whether the directory has install rules"
+    },
+    "configurationDirectoryItemJsonFileV2_3": {
+      "jsonFile": {
+        "type": "string",
+        "description": "Path to directory-specific JSON file"
+      }
+    },
+    "configurationDirectoriesV2_0": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "source",
+          "build",
+          "projectIndex"
+        ],
+        "properties": {
+          "source": {
+            "$ref": "#/definitions/configurationDirectoryItemSource"
+          },
+          "build": {
+            "$ref": "#/definitions/configurationDirectoryItemBuild"
+          },
+          "parentIndex": {
+            "$ref": "#/definitions/configurationDirectoryItemParentIndex"
+          },
+          "childIndexes": {
+            "$ref": "#/definitions/configurationDirectoryItemChildIndexes"
+          },
+          "projectIndex": {
+            "$ref": "#/definitions/configurationDirectoryItemProjectIndex"
+          },
+          "targetIndexes": {
+            "$ref": "#/definitions/configurationDirectoryItemTargetIndexes"
+          },
+          "minimumCMakeVersion": {
+            "$ref": "#/definitions/configurationDirectoryItemMinimumCMakeVersion"
+          },
+          "hasInstallRule": {
+            "$ref": "#/definitions/configurationDirectoryItemHasInstallRule"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "configurationDirectoriesV2_3": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "source",
+          "build",
+          "projectIndex"
+        ],
+        "properties": {
+          "source": {
+            "$ref": "#/definitions/configurationDirectoryItemSource"
+          },
+          "build": {
+            "$ref": "#/definitions/configurationDirectoryItemBuild"
+          },
+          "parentIndex": {
+            "$ref": "#/definitions/configurationDirectoryItemParentIndex"
+          },
+          "childIndexes": {
+            "$ref": "#/definitions/configurationDirectoryItemChildIndexes"
+          },
+          "projectIndex": {
+            "$ref": "#/definitions/configurationDirectoryItemProjectIndex"
+          },
+          "targetIndexes": {
+            "$ref": "#/definitions/configurationDirectoryItemTargetIndexes"
+          },
+          "minimumCMakeVersion": {
+            "$ref": "#/definitions/configurationDirectoryItemMinimumCMakeVersion"
+          },
+          "hasInstallRule": {
+            "$ref": "#/definitions/configurationDirectoryItemHasInstallRule"
+          },
+          "jsonFile": {
+            "$ref": "#/definitions/configurationDirectoryItemJsonFileV2_3"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "configurationName": {
+      "type": "string",
+      "description": "Configuration name (e.g., 'Debug')"
+    },
+    "configurationProjects": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "name",
+          "directoryIndexes"
+        ],
+        "properties": {
+          "name": {
+            "type": "string",
+            "description": "Project name"
+          },
+          "parentIndex": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "Index of parent project"
+          },
+          "childIndexes": {
+            "type": "array",
+            "items": {
+              "type": "integer",
+              "minimum": 0
+            },
+            "description": "Indices of child projects"
+          },
+          "directoryIndexes": {
+            "type": "array",
+            "items": {
+              "type": "integer",
+              "minimum": 0
+            },
+            "description": "Indices into directories array"
+          },
+          "targetIndexes": {
+            "type": "array",
+            "items": {
+              "type": "integer",
+              "minimum": 0
+            },
+            "description": "Indices into targets array"
+          }
+        }
+      }
+    },
+    "configurationTargets": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "name",
+          "directoryIndex",
+          "projectIndex",
+          "jsonFile"
+        ],
+        "properties": {
+          "name": {
+            "type": "string",
+            "description": "Target name"
+          },
+          "id": {
+            "type": "string",
+            "description": "Unique target identifier"
+          },
+          "directoryIndex": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "Index into directories array"
+          },
+          "projectIndex": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "Index into projects array"
+          },
+          "jsonFile": {
+            "type": "string",
+            "description": "Path to target-specific JSON file"
+          }
+        }
+      }
+    },
+    "configurationsV2_0": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "name",
+          "directories",
+          "projects",
+          "targets"
+        ],
+        "properties": {
+          "name": {
+            "$ref": "#/definitions/configurationName"
+          },
+          "projects": {
+            "$ref": "#/definitions/configurationProjects"
+          },
+          "targets": {
+            "$ref": "#/definitions/configurationTargets"
+          },
+          "directories": {
+            "$ref": "#/definitions/configurationDirectoriesV2_0"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "configurationsV2_3": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "name",
+          "directories",
+          "projects",
+          "targets"
+        ],
+        "properties": {
+          "name": {
+            "$ref": "#/definitions/configurationName"
+          },
+          "projects": {
+            "$ref": "#/definitions/configurationProjects"
+          },
+          "targets": {
+            "$ref": "#/definitions/configurationTargets"
+          },
+          "directories": {
+            "$ref": "#/definitions/configurationDirectoriesV2_3"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "codemodelV2_0": {
+      "properties": {
+        "kind": {
+          "$ref": "#/definitions/kind"
+        },
+        "version": {
+          "$ref": "#/definitions/versionV2_0"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "configurations": {
+          "$ref": "#/definitions/configurationsV2_0"
+        }
+      },
+      "additionalProperties": false
+    },
+    "codemodelV2_3": {
+      "properties": {
+        "kind": {
+          "$ref": "#/definitions/kind"
+        },
+        "version": {
+          "$ref": "#/definitions/versionV2_3"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "configurations": {
+          "$ref": "#/definitions/configurationsV2_3"
+        }
+      },
+      "additionalProperties": false
+    }
+  }
+}

+ 55 - 0
Help/manual/file_api/schema_configureLog.json

@@ -0,0 +1,55 @@
+{
+  "$schema": "http://json-schema.org/draft-07/schema#",
+  "description": "Schema for the CMake configureLog object kind",
+  "type": "object",
+  "required": [
+    "kind",
+    "version",
+    "path",
+    "eventKindNames"
+  ],
+  "properties": {
+    "kind": {
+      "type": "string",
+      "const": "configureLog"
+    },
+    "version": {
+      "type": "object",
+      "required": [
+        "major",
+        "minor"
+      ],
+      "properties": {
+        "major": {
+          "type": "integer",
+          "const": 1
+        },
+        "minor": {
+          "type": "integer",
+          "const": 0
+        }
+      },
+      "additionalProperties": false
+    },
+    "path": {
+      "type": "string",
+      "description": "Path to the configure log file. Clients must read the log file from this path, which may be different to the path in CMake's documentation. The log file specified by this path might not exist if no events have been logged."
+    },
+    "eventKindNames": {
+      "type": "array",
+      "description": "Names of versioned event kinds included in the configure log. Other event kinds might be present in the configure log, but clients must ignore those not listed in this array.",
+      "items": {
+        "type": "string",
+        "enum": [
+          "message-v1",
+          "try_compile-v1",
+          "try_run-v1",
+          "find-v1",
+          "find_package-v1"
+        ]
+      },
+      "uniqueItems": true
+    }
+  },
+  "additionalProperties": false
+}

+ 636 - 0
Help/manual/file_api/schema_directory.json

@@ -0,0 +1,636 @@
+{
+  "$schema": "http://json-schema.org/draft-07/schema#",
+  "description": "Schema for the CMake codemodel directory object",
+  "type": "object",
+  "oneOf": [
+    {
+      "$comment": "The top level codemodelVersion field was only added in version 2.9, so we can't differentiate between earlier versions",
+      "anyOf": [
+        {
+          "$ref": "#/definitions/codemodelV2_0"
+        },
+        {
+          "$ref": "#/definitions/codemodelV2_4"
+        },
+        {
+          "$ref": "#/definitions/codemodelV2_5"
+        }
+      ]
+    },
+    {
+      "$ref": "#/definitions/codemodelV2_9"
+    }
+  ],
+  "definitions": {
+    "codemodelVersionV2_9": {
+      "type": "object",
+      "required": [
+        "major",
+        "minor"
+      ],
+      "properties": {
+        "major": {
+          "type": "integer",
+          "const": 2
+        },
+        "minor": {
+          "type": "integer",
+          "minimum": 9
+        }
+      },
+      "additionalProperties": false
+    },
+    "backtraceGraph": {
+      "type": "object",
+      "required": [
+        "nodes",
+        "commands",
+        "files"
+      ],
+      "properties": {
+        "nodes": {
+          "type": "array",
+          "items": {
+            "type": "object",
+            "required": [
+              "file"
+            ],
+            "properties": {
+              "file": {
+                "type": "integer",
+                "minimum": 0,
+                "description": "0-based index into the backtrace files array"
+              },
+              "line": {
+                "type": "integer",
+                "minimum": 1,
+                "description": "This is present when the node represents a line within the file. The line number is a 1-based value."
+              },
+              "command": {
+                "type": "integer",
+                "minimum": 0,
+                "description": "This is present when the node represents a command invocation. It is a 0-based index into the backtrace commands array."
+              },
+              "parent": {
+                "type": "integer",
+                "minimum": 0,
+                "description": "This is present when the node is not the bottom of the call stack. It is a 0-based index of another node in the backtrace nodes array."
+              }
+            },
+            "additionalProperties": false
+          }
+        },
+        "commands": {
+          "type": "array",
+          "description": "Each list item is a string specifying a command name",
+          "items": {
+            "type": "string"
+          }
+        },
+        "files": {
+          "type": "array",
+          "description": "Each list item is a string specifying the path to a file, represented with forward slashes. If the file is inside the top level source directory, the path is specified relative to that directory. Otherwise, the path is absolute.",
+          "items": {
+            "type": "string"
+          }
+        }
+      },
+      "additionalProperties": false
+    },
+    "paths": {
+      "type": "object",
+      "required": [
+        "source",
+        "build"
+      ],
+      "properties": {
+        "source": {
+          "type": "string",
+          "description": "Path to the source directory. If it is inside the top level source directory, the path will be relative to that directory. For the top level source directory, this will simply be '.'. Paths outside the top level source directory will be absolute."
+        },
+        "build": {
+          "type": "string",
+          "description": "Path to the build directory. If it is inside the top level build directory, the path will be relative to that directory. For the top level build directory, this will simply be '.'. Paths outside the top level build directory will be absolute."
+        }
+      },
+      "additionalProperties": false
+    },
+    "installerComponent": {
+      "type": "string",
+      "description": "Specifies the component selected by the corresponding install command invocation"
+    },
+    "installerDestination": {
+      "type": "string",
+      "description": "The install destination path. May be absolute or relative to the install prefix"
+    },
+    "installerPaths": {
+      "type": "array",
+      "description": "Paths (files or directories) to be installed",
+      "items": {
+        "oneOf": [
+          {
+            "type": "string",
+            "description": "Path from which a file/directory is installed, also specifying the install path"
+          },
+          {
+            "type": "object",
+            "properties": {
+              "from": {
+                "type": "string",
+                "description": "Path from which a file/directory is installed"
+              },
+              "to": {
+                "type": "string",
+                "description": "Path to which the file/directory is installed under the destination"
+              }
+            },
+            "required": [
+              "from",
+              "to"
+            ]
+          }
+        ]
+      }
+    },
+    "installerItemTypesV2_0": {
+      "type": "string",
+      "enum": [
+        "file",
+        "directory",
+        "target",
+        "export",
+        "script",
+        "code",
+        "importedRuntimeArtifacts",
+        "runtimeDependencySet"
+      ]
+    },
+    "installerItemTypesV2_4": {
+      "type": "string",
+      "enum": [
+        "fileSet"
+      ]
+    },
+    "installerItemTypesV2_5": {
+      "type": "string",
+      "enum": [
+        "cxxModuleBmi"
+      ]
+    },
+    "installerTypeV2_0": {
+      "$ref": "#/definitions/installerItemTypesV2_0",
+      "description": "Type of installation rule"
+    },
+    "installerTypeV2_4": {
+      "anyOf": [
+        {
+          "$ref": "#/definitions/installerItemTypesV2_0"
+        },
+        {
+          "$ref": "#/definitions/installerItemTypesV2_4"
+        }
+      ],
+      "description": "Type of installation rule"
+    },
+    "installerTypeV2_5": {
+      "anyOf": [
+        {
+          "$ref": "#/definitions/installerItemTypesV2_0"
+        },
+        {
+          "$ref": "#/definitions/installerItemTypesV2_4"
+        },
+        {
+          "$ref": "#/definitions/installerItemTypesV2_5"
+        }
+      ],
+      "description": "Type of installation rule"
+    },
+    "installerIsExcludeFromAll": {
+      "type": "boolean",
+      "description": "Present when install is called with EXCLUDE_FROM_ALL option"
+    },
+    "installerIsForAllComponents": {
+      "type": "boolean",
+      "description": "Present when install(SCRIPT|CODE) is called with ALL_COMPONENTS option"
+    },
+    "installerIsOptional": {
+      "type": "boolean",
+      "description": "Present when install is called with OPTIONAL option"
+    },
+    "installerTargetId": {
+      "type": "string",
+      "description": "Uniquely identifying string for the target to be installed"
+    },
+    "installerTargetIndex": {
+      "type": "integer",
+      "minimum": 0,
+      "description": "0-based index into the codemodel targets array"
+    },
+    "installerTargetIsImportLibrary": {
+      "type": "boolean",
+      "description": "Present for Windows DLL import library or AIX linker import file"
+    },
+    "installerTargetInstallNamelink": {
+      "type": "string",
+      "enum": [
+        "skip",
+        "only"
+      ],
+      "description": "How to handle symlinks for VERSION/SOVERSION target properties"
+    },
+    "installerExportName": {
+      "type": "string",
+      "description": "Name of the export for export type"
+    },
+    "installerExportTargets": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "properties": {
+          "id": {
+            "type": "string",
+            "description": "String uniquely identifying the target"
+          },
+          "index": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "0-based index into the codemodel targets array"
+          }
+        },
+        "additionalProperties": false,
+        "required": [
+          "id",
+          "index"
+        ]
+      }
+    },
+    "installerRuntimeDependencySetName": {
+      "type": "string",
+      "description": "Name of the runtime dependency set"
+    },
+    "installerRuntimeDependencySetType": {
+      "type": "string",
+      "enum": [
+        "library",
+        "framework"
+      ],
+      "description": "Type of runtime dependency set"
+    },
+    "installerScriptFile": {
+      "type": "string",
+      "description": "Path to the script file on disk"
+    },
+    "installerBacktrace": {
+      "type": "integer",
+      "minimum": 0,
+      "description": "0-based index into the backtraceGraph nodes array"
+    },
+    "installerFileSetNameV2_4": {
+      "type": "string",
+      "description": "Name of the file set"
+    },
+    "installerFileSetTypeV2_4": {
+      "type": "string",
+      "description": "Type of the file set"
+    },
+    "installerFileSetDirectoriesV2_4": {
+      "type": "array",
+      "items": {
+        "type": "string"
+      },
+      "description": "File set's base directories"
+    },
+    "installerFileSetTargetV2_4": {
+      "type": "object",
+      "required": [
+        "id",
+        "index"
+      ],
+      "properties": {
+        "id": {
+          "type": "string",
+          "description": "String uniquely identifying the target"
+        },
+        "index": {
+          "type": "integer",
+          "minimum": 0,
+          "description": "0-based index into the codemodel targets array"
+        }
+      },
+      "additionalProperties": false
+    },
+    "installerCxxModuleBmiTargetV2_5": {
+      "type": "object",
+      "properties": {
+        "id": {
+          "type": "string"
+        },
+        "index": {
+          "type": "integer",
+          "minimum": 0
+        }
+      },
+      "additionalProperties": false
+    },
+    "installersV2_0": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "component",
+          "type"
+        ],
+        "properties": {
+          "component": {
+            "$ref": "#/definitions/installerComponent"
+          },
+          "destination": {
+            "$ref": "#/definitions/installerDestination"
+          },
+          "paths": {
+            "$ref": "#/definitions/installerPaths"
+          },
+          "type": {
+            "$ref": "#/definitions/installerTypeV2_0"
+          },
+          "isExcludeFromAll": {
+            "$ref": "#/definitions/installerIsExcludeFromAll"
+          },
+          "isForAllComponents": {
+            "$ref": "#/definitions/installerIsForAllComponents"
+          },
+          "isOptional": {
+            "$ref": "#/definitions/installerIsOptional"
+          },
+          "targetId": {
+            "$ref": "#/definitions/installerTargetId"
+          },
+          "targetIndex": {
+            "$ref": "#/definitions/installerTargetIndex"
+          },
+          "targetIsImportLibrary": {
+            "$ref": "#/definitions/installerTargetIsImportLibrary"
+          },
+          "targetInstallNamelink": {
+            "$ref": "#/definitions/installerTargetInstallNamelink"
+          },
+          "exportName": {
+            "$ref": "#/definitions/installerExportName"
+          },
+          "exportTargets": {
+            "$ref": "#/definitions/installerExportTargets"
+          },
+          "runtimeDependencySetName": {
+            "$ref": "#/definitions/installerRuntimeDependencySetName"
+          },
+          "runtimeDependencySetType": {
+            "$ref": "#/definitions/installerRuntimeDependencySetType"
+          },
+          "scriptFile": {
+            "$ref": "#/definitions/installerScriptFile"
+          },
+          "backtrace": {
+            "$ref": "#/definitions/installerBacktrace"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "installersV2_4": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "component",
+          "type"
+        ],
+        "properties": {
+          "component": {
+            "$ref": "#/definitions/installerComponent"
+          },
+          "destination": {
+            "$ref": "#/definitions/installerDestination"
+          },
+          "paths": {
+            "$ref": "#/definitions/installerPaths"
+          },
+          "type": {
+            "$ref": "#/definitions/installerTypeV2_0"
+          },
+          "isExcludeFromAll": {
+            "$ref": "#/definitions/installerIsExcludeFromAll"
+          },
+          "isForAllComponents": {
+            "$ref": "#/definitions/installerIsForAllComponents"
+          },
+          "isOptional": {
+            "$ref": "#/definitions/installerIsOptional"
+          },
+          "targetId": {
+            "$ref": "#/definitions/installerTargetId"
+          },
+          "targetIndex": {
+            "$ref": "#/definitions/installerTargetIndex"
+          },
+          "targetIsImportLibrary": {
+            "$ref": "#/definitions/installerTargetIsImportLibrary"
+          },
+          "targetInstallNamelink": {
+            "$ref": "#/definitions/installerTargetInstallNamelink"
+          },
+          "exportName": {
+            "$ref": "#/definitions/installerExportName"
+          },
+          "exportTargets": {
+            "$ref": "#/definitions/installerExportTargets"
+          },
+          "runtimeDependencySetName": {
+            "$ref": "#/definitions/installerRuntimeDependencySetName"
+          },
+          "runtimeDependencySetType": {
+            "$ref": "#/definitions/installerRuntimeDependencySetType"
+          },
+          "scriptFile": {
+            "$ref": "#/definitions/installerScriptFile"
+          },
+          "backtrace": {
+            "$ref": "#/definitions/installerBacktrace"
+          },
+          "fileSetName": {
+            "$ref": "#/definitions/installerFileSetNameV2_4"
+          },
+          "fileSetType": {
+            "$ref": "#/definitions/installerFileSetTypeV2_4"
+          },
+          "fileSetDirectories": {
+            "$ref": "#/definitions/installerFileSetDirectoriesV2_4"
+          },
+          "fileSetTarget": {
+            "$ref": "#/definitions/installerFileSetTargetV2_4"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "installersV2_5": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "component",
+          "type"
+        ],
+        "properties": {
+          "component": {
+            "$ref": "#/definitions/installerComponent"
+          },
+          "destination": {
+            "$ref": "#/definitions/installerDestination"
+          },
+          "paths": {
+            "$ref": "#/definitions/installerPaths"
+          },
+          "type": {
+            "$ref": "#/definitions/installerTypeV2_5"
+          },
+          "isExcludeFromAll": {
+            "$ref": "#/definitions/installerIsExcludeFromAll"
+          },
+          "isForAllComponents": {
+            "$ref": "#/definitions/installerIsForAllComponents"
+          },
+          "isOptional": {
+            "$ref": "#/definitions/installerIsOptional"
+          },
+          "targetId": {
+            "$ref": "#/definitions/installerTargetId"
+          },
+          "targetIndex": {
+            "$ref": "#/definitions/installerTargetIndex"
+          },
+          "targetIsImportLibrary": {
+            "$ref": "#/definitions/installerTargetIsImportLibrary"
+          },
+          "targetInstallNamelink": {
+            "$ref": "#/definitions/installerTargetInstallNamelink"
+          },
+          "exportName": {
+            "$ref": "#/definitions/installerExportName"
+          },
+          "exportTargets": {
+            "$ref": "#/definitions/installerExportTargets"
+          },
+          "runtimeDependencySetName": {
+            "$ref": "#/definitions/installerRuntimeDependencySetName"
+          },
+          "runtimeDependencySetType": {
+            "$ref": "#/definitions/installerRuntimeDependencySetType"
+          },
+          "scriptFile": {
+            "$ref": "#/definitions/installerScriptFile"
+          },
+          "backtrace": {
+            "$ref": "#/definitions/installerBacktrace"
+          },
+          "fileSetName": {
+            "$ref": "#/definitions/installerFileSetNameV2_4"
+          },
+          "fileSetType": {
+            "$ref": "#/definitions/installerFileSetTypeV2_4"
+          },
+          "fileSetDirectories": {
+            "$ref": "#/definitions/installerFileSetDirectoriesV2_4"
+          },
+          "fileSetTarget": {
+            "$ref": "#/definitions/installerFileSetTargetV2_4"
+          },
+          "cxxModuleBmiTarget": {
+            "$ref": "#/definitions/installerCxxModuleBmiTargetV2_5"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "codemodelV2_0": {
+      "required": [
+        "backtraceGraph",
+        "paths",
+        "installers"
+      ],
+      "properties": {
+        "backtraceGraph": {
+          "$ref": "#/definitions/backtraceGraph"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "installers": {
+          "$ref": "#/definitions/installersV2_0"
+        }
+      },
+      "additionalProperties": false
+    },
+    "codemodelV2_4": {
+      "required": [
+        "backtraceGraph",
+        "paths",
+        "installers"
+      ],
+      "properties": {
+        "backtraceGraph": {
+          "$ref": "#/definitions/backtraceGraph"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "installers": {
+          "$ref": "#/definitions/installersV2_4"
+        }
+      },
+      "additionalProperties": false
+    },
+    "codemodelV2_5": {
+      "required": [
+        "backtraceGraph",
+        "paths",
+        "installers"
+      ],
+      "properties": {
+        "backtraceGraph": {
+          "$ref": "#/definitions/backtraceGraph"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "installers": {
+          "$ref": "#/definitions/installersV2_5"
+        }
+      },
+      "additionalProperties": false
+    },
+    "codemodelV2_9": {
+      "required": [
+        "codemodelVersion",
+        "backtraceGraph",
+        "paths",
+        "installers"
+      ],
+      "properties": {
+        "codemodelVersion": {
+          "$ref": "#/definitions/codemodelVersionV2_9"
+        },
+        "backtraceGraph": {
+          "$ref": "#/definitions/backtraceGraph"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "installers": {
+          "$ref": "#/definitions/installersV2_5"
+        }
+      },
+      "additionalProperties": false
+    }
+  }
+}

+ 248 - 0
Help/manual/file_api/schema_index.json

@@ -0,0 +1,248 @@
+{
+  "$schema": "http://json-schema.org/draft-07/schema#",
+  "type": "object",
+  "required": [
+    "cmake",
+    "objects",
+    "reply"
+  ],
+  "properties": {
+    "cmake": {
+      "type": "object",
+      "description": "High level details about CMake itself and the CMake generator used",
+      "required": [
+        "version",
+        "paths",
+        "generator"
+      ],
+      "properties": {
+        "version": {
+          "description": "Full version details of the CMake used to produce the replies",
+          "type": "object",
+          "required": [
+            "major",
+            "minor",
+            "patch",
+            "string",
+            "isDirty"
+          ],
+          "properties": {
+            "major": {
+              "type": "integer",
+              "minimum": 3
+            },
+            "minor": {
+              "type": "integer",
+              "minimum": 0
+            },
+            "patch": {
+              "type": "integer",
+              "minimum": 0
+            },
+            "suffix": {
+              "type": "string",
+              "description": "A version suffix may be present when CMake is built from sources, or for release candidates. Official releases do not normally have a suffix."
+            },
+            "string": {
+              "type": "string",
+              "description": "The full version string in the format <major>.<minor>.<patch>[-<suffix>]"
+            },
+            "isDirty": {
+              "type": "boolean",
+              "description": "When this is true, it indicates CMake was built from a version-controlled source tree with local modifications"
+            }
+          },
+          "additionalProperties": false
+        },
+        "paths": {
+          "description": "Absolute paths to tools and locations within the CMake installation",
+          "type": "object",
+          "required": [
+            "cmake",
+            "ctest",
+            "cpack",
+            "root"
+          ],
+          "properties": {
+            "cmake": {
+              "description": "Absolute path to the cmake executable",
+              "type": "string"
+            },
+            "ctest": {
+              "description": "Absolute path to the ctest executable",
+              "type": "string"
+            },
+            "cpack": {
+              "description": "Absolute path to the cpack executable",
+              "type": "string"
+            },
+            "root": {
+              "description": "Absolute path to the directory containing CMake resources like the Modules directory",
+              "type": "string"
+            }
+          },
+          "additionalProperties": false
+        },
+        "generator": {
+          "description": "Details for the CMake generator used",
+          "type": "object",
+          "required": [
+            "multiConfig",
+            "name"
+          ],
+          "properties": {
+            "multiConfig": {
+              "description": "True for multi-configuration generators, false for single-configuration generators",
+              "type": "boolean"
+            },
+            "name": {
+              "type": "string"
+            },
+            "platform": {
+              "description": "This string will only be set if the generator supports the CMAKE_GENERATOR_PLATFORM variable, which specifies the generator platform name",
+              "type": "string"
+            }
+          },
+          "additionalProperties": false
+        }
+      }
+    },
+    "objects": {
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/kindJsonFile"
+      }
+    },
+    "reply": {
+      "type": "object",
+      "patternProperties": {
+        "^[^-]+-v\\d+$": {
+          "description": "A member of this form appears for each of the shared stateless query files that CMake recognized as a request for the specified object kind and major version",
+          "oneOf": [
+            {
+              "$ref": "#/definitions/kindJsonFile"
+            },
+            {
+              "description": "A member of this form appears if the query's object kind is not recognized or is malformed",
+              "$ref": "#/definitions/replyError"
+            }
+          ]
+        },
+        "^client-[^/]+$": {
+          "description": "A member of this form appears for each client-owned directory holding client stateless query files. The value is a JSON object mirroring the content of the query/client-<client>/ directory.",
+          "patternProperties": {
+            "^[^-]+-v\\d+$": {
+              "description": "A member of this form appears for each of the client stateless query files that CMake recognized as a request for the specified object kind and major version",
+              "oneOf": [
+                {
+                  "$ref": "#/definitions/kindJsonFile"
+                },
+                {
+                  "description": "A member of this form appears if the client query's object kind is not recognized or is malformed",
+                  "$ref": "#/definitions/replyError"
+                }
+              ]
+            },
+            "^query\\.json$": {
+              "description": "This member appears for clients using client stateful query files",
+              "oneOf": [
+                {
+                  "type": "object",
+                  "properties": {
+                    "client": {
+                      "type": "object"
+                    },
+                    "requests": {},
+                    "responses": {
+                      "oneOf": [
+                        {
+                          "$ref": "#/definitions/replyError"
+                        },
+                        {
+                          "type": "array",
+                          "items": {
+                            "oneOf": [
+                              {
+                                "$ref": "#/definitions/kindJsonFile"
+                              },
+                              {
+                                "$ref": "#/definitions/replyError"
+                              }
+                            ]
+                          }
+                        }
+                      ]
+                    }
+                  },
+                  "additionalProperties": false
+                },
+                {
+                  "description": "A member of this form appears if the query.json file failed to read or parse as a JSON object",
+                  "$ref": "#/definitions/replyError"
+                }
+              ]
+            }
+          },
+          "additionalProperties": {
+            "description": "A member of this form appears for each of the client stateless query files that CMake did not recognize.",
+            "$ref": "#/definitions/replyError"
+          }
+        }
+      },
+      "additionalProperties": {
+        "description": "A member of this form appears for each of the shared stateless query files that CMake did not recognize.",
+        "$ref": "#/definitions/replyError"
+      }
+    }
+  },
+  "definitions": {
+    "kindJsonFile": {
+      "type": "object",
+      "required": [
+        "kind",
+        "version",
+        "jsonFile"
+      ],
+      "properties": {
+        "kind": {
+          "type": "string"
+        },
+        "version": {
+          "type": "object",
+          "required": [
+            "major",
+            "minor"
+          ],
+          "properties": {
+            "major": {
+              "type": "integer",
+              "minimum": 1
+            },
+            "minor": {
+              "type": "integer",
+              "minimum": 0
+            }
+          },
+          "additionalProperties": false
+        },
+        "jsonFile": {
+          "type": "string",
+          "description": "Specifies a path relative to the reply index file to another JSON file containing the object"
+        }
+      },
+      "additionalProperties": false
+    },
+    "replyError": {
+      "type": "object",
+      "required": [
+        "error"
+      ],
+      "properties": {
+        "error": {
+          "type": "string"
+        }
+      },
+      "additionalProperties": false
+    }
+  }
+}

+ 84 - 0
Help/manual/file_api/schema_stateful_query.json

@@ -0,0 +1,84 @@
+{
+  "$schema": "http://json-schema.org/draft-07/schema#",
+  "description": "Schema for CMake file API query.json files",
+  "type": "object",
+  "required": [
+    "requests"
+  ],
+  "properties": {
+    "requests": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "kind",
+          "version"
+        ],
+        "properties": {
+          "kind": {
+            "type": "string",
+            "description": "Specifies one of the Object Kinds to be included in the reply"
+          },
+          "version": {
+            "description": "Version(s) of the object kind that the client understands",
+            "oneOf": [
+              {
+                "$ref": "#/definitions/versionMajorOnly"
+              },
+              {
+                "$ref": "#/definitions/versionObject"
+              },
+              {
+                "type": "array",
+                "items": {
+                  "oneOf": [
+                    {
+                      "$ref": "#/definitions/versionMajorOnly"
+                    },
+                    {
+                      "$ref": "#/definitions/versionObject"
+                    }
+                  ]
+                }
+              }
+            ]
+          },
+          "client": {
+            "description": "Optional member reserved for use by the client. This value is preserved in the reply."
+          }
+        }
+      }
+    },
+    "client": {
+      "description": "Optional member reserved for use by the client. This value is preserved in the reply."
+    }
+  },
+  "$comment": "Other top level properties are reserved for future use. If present, they are ignored for forward compatibility.",
+  "additionalProperties": true,
+  "definitions": {
+    "versionMajorOnly": {
+      "type": "integer",
+      "description": "A non-negative major version number",
+      "minimum": 0
+    },
+    "versionObject": {
+      "type": "object",
+      "required": [
+        "major"
+      ],
+      "properties": {
+        "major": {
+          "type": "integer",
+          "description": "The major version number",
+          "minimum": 0
+        },
+        "minor": {
+          "type": "integer",
+          "description": "The minor version number",
+          "minimum": 0
+        }
+      },
+      "additionalProperties": false
+    }
+  }
+}

+ 1398 - 0
Help/manual/file_api/schema_target.json

@@ -0,0 +1,1398 @@
+{
+  "$schema": "http://json-schema.org/draft-07/schema#",
+  "description": "Schema for the CMake codemodel target object",
+  "type": "object",
+  "oneOf": [
+    {
+      "$comment": "The top level codemodelVersion field was only added in version 2.9, so we can't differentiate between earlier versions",
+      "anyOf": [
+        {
+          "$ref": "#/definitions/codemodelV2_0"
+        },
+        {
+          "$ref": "#/definitions/codemodelV2_1"
+        },
+        {
+          "$ref": "#/definitions/codemodelV2_2"
+        },
+        {
+          "$ref": "#/definitions/codemodelV2_5"
+        },
+        {
+          "$ref": "#/definitions/codemodelV2_6"
+        },
+        {
+          "$ref": "#/definitions/codemodelV2_7"
+        },
+        {
+          "$ref": "#/definitions/codemodelV2_8"
+        }
+      ]
+    },
+    {
+      "$ref": "#/definitions/codemodelV2_9"
+    }
+  ],
+  "definitions": {
+    "codemodelVersionV2_9": {
+      "type": "object",
+      "required": [
+        "major",
+        "minor"
+      ],
+      "properties": {
+        "major": {
+          "type": "integer",
+          "const": 2
+        },
+        "minor": {
+          "type": "integer",
+          "minimum": 9
+        }
+      },
+      "additionalProperties": false
+    },
+    "name": {
+      "type": "string",
+      "description": "Logical name of the target"
+    },
+    "id": {
+      "type": "string",
+      "description": "Unique identifier for the target. The format is unspecified and should not be interpreted by clients."
+    },
+    "type": {
+      "type": "string",
+      "enum": [
+        "EXECUTABLE",
+        "STATIC_LIBRARY",
+        "SHARED_LIBRARY",
+        "MODULE_LIBRARY",
+        "OBJECT_LIBRARY",
+        "INTERFACE_LIBRARY",
+        "UTILITY"
+      ]
+    },
+    "backtrace": {
+      "type": "integer",
+      "minimum": 0,
+      "description": "Index into backtraceGraph nodes array"
+    },
+    "folder": {
+      "type": "object",
+      "description": "This will only be present if the FOLDER target property is set",
+      "required": [
+        "name"
+      ],
+      "properties": {
+        "name": {
+          "type": "string",
+          "description": "Name of the folder to place the target under in IDEs and other GUI tools"
+        }
+      },
+      "additionalProperties": false
+    },
+    "paths": {
+      "type": "object",
+      "required": [
+        "source",
+        "build"
+      ],
+      "properties": {
+        "source": {
+          "type": "string",
+          "description": "Path to the source directory. If it is inside the top level source directory, the path will be relative to that directory. For the top level source directory, this will simply be '.'. Paths outside the top level source directory will be absolute."
+        },
+        "build": {
+          "type": "string",
+          "description": "Path to the build directory. If it is inside the top level build directory, the path will be relative to that directory. For the top level build directory, this will simply be '.'. Paths outside the top level build directory will be absolute."
+        }
+      },
+      "additionalProperties": false
+    },
+    "nameOnDisk": {
+      "type": "string",
+      "description": "File name of the primary artifact on disk, only present for executable and library targets that are linked or archived into a single primary artifact"
+    },
+    "artifacts": {
+      "type": "array",
+      "description": "Only present for executable and library targets that produce artifacts on disk meant for consumption by dependents",
+      "items": {
+        "type": "object",
+        "required": [
+          "path"
+        ],
+        "properties": {
+          "path": {
+            "type": "string",
+            "description": "Path to artifact file on disk. If the file is inside the top-level build directory, the path is specified relative to that directory. Otherwise, the path is absolute."
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "isGeneratorProvided": {
+      "type": "boolean",
+      "description": "Only present and will have the value true if the target is provided by CMake's build system generator rather than by a command in the project's source code"
+    },
+    "install": {
+      "type": "object",
+      "description": "Only present if the target has an install() rule",
+      "required": [
+        "prefix",
+        "destinations"
+      ],
+      "properties": {
+        "prefix": {
+          "type": "object",
+          "required": [
+            "path"
+          ],
+          "properties": {
+            "path": {
+              "type": "string",
+              "description": "The value of CMAKE_INSTALL_PREFIX"
+            }
+          },
+          "additionalProperties": false
+        },
+        "destinations": {
+          "type": "array",
+          "items": {
+            "type": "object",
+            "required": [
+              "path"
+            ],
+            "properties": {
+              "path": {
+                "type": "string",
+                "description": "Install destination path. It may be absolute or relative to the install prefix."
+              },
+              "backtrace": {
+                "type": "integer",
+                "minimum": 0,
+                "description": "Index into the backtraceGraph nodes array, if a backtrace is available"
+              }
+            },
+            "additionalProperties": false
+          }
+        }
+      },
+      "additionalProperties": false
+    },
+    "launchersV2_7": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "command",
+          "type"
+        ],
+        "properties": {
+          "command": {
+            "type": "string",
+            "description": "Path to the launcher on disk. If the file is inside the top-level source directory, the path is specified relative to that directory."
+          },
+          "arguments": {
+            "type": "array",
+            "items": {
+              "type": "string"
+            },
+            "description": "Arguments preceding the executable"
+          },
+          "type": {
+            "type": "string",
+            "enum": [
+              "emulator",
+              "test"
+            ],
+            "description": "Type of launcher"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "link": {
+      "type": "object",
+      "description": "This is only present for executables and shared library targets that link into a runtime binary",
+      "required": [
+        "language"
+      ],
+      "properties": {
+        "language": {
+          "type": "string",
+          "description": "Language of the toolchain used to invoke the linker"
+        },
+        "commandFragments": {
+          "type": "array",
+          "description": "Ordered fragments of the link command line, if available",
+          "items": {
+            "type": "object",
+            "required": [
+              "fragment",
+              "role"
+            ],
+            "properties": {
+              "fragment": {
+                "type": "string",
+                "description": "Fragment of link command line"
+              },
+              "role": {
+                "type": "string",
+                "enum": [
+                  "flags",
+                  "libraries",
+                  "libraryPath",
+                  "frameworkPath"
+                ],
+                "description": "Role of the fragment content"
+              },
+              "backtrace": {
+                "type": "integer",
+                "minimum": 0,
+                "description": "Index into backtraceGraph nodes array for the command that added the link fragment, if available"
+              }
+            },
+            "additionalProperties": false
+          }
+        },
+        "lto": {
+          "type": "boolean",
+          "description": "True if link-time optimization is enabled"
+        },
+        "sysroot": {
+          "type": "object",
+          "description": "Only present when the CMAKE_SYSROOT_LINK or CMAKE_SYSROOT variable is defined",
+          "required": [
+            "path"
+          ],
+          "properties": {
+            "path": {
+              "type": "string",
+              "description": "Absolute path to the sysroot"
+            }
+          },
+          "additionalProperties": false
+        }
+      },
+      "additionalProperties": false
+    },
+    "archive": {
+      "type": "object",
+      "description": "Only present for static library targets",
+      "properties": {
+        "commandFragments": {
+          "type": "array",
+          "description": "Ordered fragments of the archiver command line, if available",
+          "items": {
+            "type": "object",
+            "required": [
+              "fragment",
+              "role"
+            ],
+            "properties": {
+              "fragment": {
+                "type": "string",
+                "description": "Fragment of the archiver command line"
+              },
+              "role": {
+                "type": "string",
+                "enum": [
+                  "flags"
+                ],
+                "description": "Role of the fragment content"
+              }
+            },
+            "additionalProperties": false
+          }
+        },
+        "lto": {
+          "type": "boolean",
+          "description": "True if link-time optimization is enabled"
+        }
+      },
+      "additionalProperties": false
+    },
+    "debuggerV2_8": {
+      "type": "object",
+      "properties": {
+        "workingDirectory": {
+          "type": "string",
+          "description": "Working directory for a debugger"
+        }
+      },
+      "additionalProperties": false
+    },
+    "dependencies": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "id"
+        ],
+        "properties": {
+          "id": {
+            "type": "string",
+            "description": "Unique identifier of another target on which this one depends"
+          },
+          "backtrace": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "Index into backtraceGraph nodes array of the command that created the dependency, if available"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "fileSetsV2_5": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "name",
+          "type",
+          "visibility",
+          "baseDirectories"
+        ],
+        "properties": {
+          "name": {
+            "type": "string"
+          },
+          "type": {
+            "type": "string",
+            "enum": [
+              "HEADERS",
+              "CXX_MODULES"
+            ]
+          },
+          "visibility": {
+            "type": "string",
+            "enum": [
+              "PUBLIC",
+              "PRIVATE",
+              "INTERFACE"
+            ]
+          },
+          "baseDirectories": {
+            "type": "array",
+            "minItems": 1,
+            "items": {
+              "type": "string"
+            },
+            "description": "Base directories containing the file set's files. If a directory is inside the top level source directory, its path is specified relative to that directory. Otherwise, its path is absolute."
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "sourcesPath": {
+      "type": "string",
+      "description": "Path to the source file. If the file is inside the top level source directory, the path is specified relative to that directory. Otherwise, the path is absolute."
+    },
+    "sourcesCompileGroupIndex": {
+      "type": "integer",
+      "minimum": 0,
+      "description": "Index into the compileGroups array. Only present if the file is compiled."
+    },
+    "sourcesSourceGroupIndex": {
+      "type": "integer",
+      "minimum": 0,
+      "description": "Index into the sourceGroups array. Only present if the file is part of a source group."
+    },
+    "sourcesIsGenerated": {
+      "type": "boolean",
+      "description": "True if the file has its GENERATED property set to true"
+    },
+    "sourcesFileSetIndexV2_5": {
+      "type": "integer",
+      "minimum": 0,
+      "description": "Index into the fileSets array. Only present if the file is part of a file set."
+    },
+    "sourcesV2_0": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "path"
+        ],
+        "properties": {
+          "path": {
+            "$ref": "#/definitions/sourcesPath"
+          },
+          "compileGroupIndex": {
+            "$ref": "#/definitions/sourcesCompileGroupIndex"
+          },
+          "sourceGroupIndex": {
+            "$ref": "#/definitions/sourcesSourceGroupIndex"
+          },
+          "isGenerated": {
+            "$ref": "#/definitions/sourcesIsGenerated"
+          },
+          "backtrace": {
+            "$ref": "#/definitions/backtrace"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "sourcesV2_5": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "path"
+        ],
+        "properties": {
+          "path": {
+            "$ref": "#/definitions/sourcesPath"
+          },
+          "compileGroupIndex": {
+            "$ref": "#/definitions/sourcesCompileGroupIndex"
+          },
+          "sourceGroupIndex": {
+            "$ref": "#/definitions/sourcesSourceGroupIndex"
+          },
+          "isGenerated": {
+            "$ref": "#/definitions/sourcesIsGenerated"
+          },
+          "backtrace": {
+            "$ref": "#/definitions/backtrace"
+          },
+          "fileSetIndex": {
+            "$ref": "#/definitions/sourcesFileSetIndexV2_5"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "sourceGroups": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "name",
+          "sourceIndexes"
+        ],
+        "properties": {
+          "name": {
+            "type": "string",
+            "description": "Name of source group"
+          },
+          "sourceIndexes": {
+            "type": "array",
+            "items": {
+              "type": "integer",
+              "minimum": 0
+            },
+            "description": "Indices into sources array"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "compileGroupsSourceIndexes": {
+      "type": "array",
+      "items": {
+        "type": "integer",
+        "minimum": 0
+      },
+      "description": "Indices into the sources array for sources belonging to the group"
+    },
+    "compileGroupsLanguage": {
+      "type": "string",
+      "description": "Language used to compile sources in the group"
+    },
+    "compileGroupsLanguageStandardV2_2": {
+      "type": "object",
+      "required": [
+        "backtraces",
+        "standard"
+      ],
+      "properties": {
+        "backtraces": {
+          "type": "array",
+          "items": {
+            "type": "integer",
+            "minimum": 0
+          },
+          "description": "Indices into the backtraceGraph nodes array"
+        },
+        "standard": {
+          "type": "string",
+          "description": "Language standard"
+        }
+      },
+      "additionalProperties": false
+    },
+    "compileGroupsCompileCommandFragments": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "fragment"
+        ],
+        "properties": {
+          "fragment": {
+            "type": "string",
+            "description": "Fragment of the compile command line"
+          },
+          "backtrace": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "Index into the backtraceGraph nodes array"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "compileGroupsIncludes": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "path"
+        ],
+        "properties": {
+          "path": {
+            "type": "string",
+            "description": "Include directory path"
+          },
+          "isSystem": {
+            "type": "boolean",
+            "description": "True if the path is a system include directory"
+          },
+          "backtrace": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "Index into the backtraceGraph nodes array"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "compileGroupsFrameworksV2_6": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "path"
+        ],
+        "properties": {
+          "path": {
+            "type": "string",
+            "description": "Framework directory path"
+          },
+          "isSystem": {
+            "type": "boolean",
+            "description": "True if the path is to a system framework directory"
+          },
+          "backtrace": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "Index into the backtraceGraph nodes array"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "compileGroupsPrecompileHeadersV2_1": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "header"
+        ],
+        "properties": {
+          "header": {
+            "type": "string",
+            "description": "Path to the precompile header file"
+          },
+          "backtrace": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "Index into the backtraceGraph nodes array"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "compileGroupsDefines": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "define"
+        ],
+        "properties": {
+          "define": {
+            "type": "string",
+            "description": "Preprocessor definition in name or name=value format"
+          },
+          "backtrace": {
+            "type": "integer",
+            "minimum": 0,
+            "description": "Index into the backtraceGraph nodes array"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "compileGroupsSysroot": {
+      "type": "object",
+      "required": [
+        "path"
+      ],
+      "properties": {
+        "path": {
+          "type": "string",
+          "description": "Absolute path to the sysroot"
+        }
+      },
+      "additionalProperties": false
+    },
+    "compileGroupsV2_0": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "sourceIndexes",
+          "language"
+        ],
+        "properties": {
+          "sourceIndexes": {
+            "$ref": "#/definitions/compileGroupsSourceIndexes"
+          },
+          "language": {
+            "$ref": "#/definitions/compileGroupsLanguage"
+          },
+          "compileCommandFragments": {
+            "$ref": "#/definitions/compileGroupsCompileCommandFragments"
+          },
+          "includes": {
+            "$ref": "#/definitions/compileGroupsIncludes"
+          },
+          "defines": {
+            "$ref": "#/definitions/compileGroupsDefines"
+          },
+          "sysroot": {
+            "$ref": "#/definitions/compileGroupsSysroot"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "compileGroupsV2_1": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "sourceIndexes",
+          "language"
+        ],
+        "properties": {
+          "sourceIndexes": {
+            "$ref": "#/definitions/compileGroupsSourceIndexes"
+          },
+          "language": {
+            "$ref": "#/definitions/compileGroupsLanguage"
+          },
+          "compileCommandFragments": {
+            "$ref": "#/definitions/compileGroupsCompileCommandFragments"
+          },
+          "includes": {
+            "$ref": "#/definitions/compileGroupsIncludes"
+          },
+          "precompileHeaders": {
+            "$ref": "#/definitions/compileGroupsPrecompileHeadersV2_1"
+          },
+          "defines": {
+            "$ref": "#/definitions/compileGroupsDefines"
+          },
+          "sysroot": {
+            "$ref": "#/definitions/compileGroupsSysroot"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "compileGroupsV2_2": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "sourceIndexes",
+          "language"
+        ],
+        "properties": {
+          "sourceIndexes": {
+            "$ref": "#/definitions/compileGroupsSourceIndexes"
+          },
+          "language": {
+            "$ref": "#/definitions/compileGroupsLanguage"
+          },
+          "languageStandard": {
+            "$ref": "#/definitions/compileGroupsLanguageStandardV2_2"
+          },
+          "compileCommandFragments": {
+            "$ref": "#/definitions/compileGroupsCompileCommandFragments"
+          },
+          "includes": {
+            "$ref": "#/definitions/compileGroupsIncludes"
+          },
+          "precompileHeaders": {
+            "$ref": "#/definitions/compileGroupsPrecompileHeadersV2_1"
+          },
+          "defines": {
+            "$ref": "#/definitions/compileGroupsDefines"
+          },
+          "sysroot": {
+            "$ref": "#/definitions/compileGroupsSysroot"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "compileGroupsV2_6": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": [
+          "sourceIndexes",
+          "language"
+        ],
+        "properties": {
+          "sourceIndexes": {
+            "$ref": "#/definitions/compileGroupsSourceIndexes"
+          },
+          "language": {
+            "$ref": "#/definitions/compileGroupsLanguage"
+          },
+          "languageStandard": {
+            "$ref": "#/definitions/compileGroupsLanguageStandardV2_2"
+          },
+          "compileCommandFragments": {
+            "$ref": "#/definitions/compileGroupsCompileCommandFragments"
+          },
+          "includes": {
+            "$ref": "#/definitions/compileGroupsIncludes"
+          },
+          "frameworks": {
+            "$ref": "#/definitions/compileGroupsFrameworksV2_6"
+          },
+          "precompileHeaders": {
+            "$ref": "#/definitions/compileGroupsPrecompileHeadersV2_1"
+          },
+          "defines": {
+            "$ref": "#/definitions/compileGroupsDefines"
+          },
+          "sysroot": {
+            "$ref": "#/definitions/compileGroupsSysroot"
+          }
+        },
+        "additionalProperties": false
+      }
+    },
+    "backtraceGraph": {
+      "type": "object",
+      "required": [
+        "nodes",
+        "commands",
+        "files"
+      ],
+      "properties": {
+        "nodes": {
+          "type": "array",
+          "items": {
+            "type": "object",
+            "required": [
+              "file"
+            ],
+            "properties": {
+              "file": {
+                "type": "integer",
+                "minimum": 0,
+                "description": "0-based index into the backtrace files array"
+              },
+              "line": {
+                "type": "integer",
+                "minimum": 1,
+                "description": "This is present when the node represents a line within the file. The line number is a 1-based value."
+              },
+              "command": {
+                "type": "integer",
+                "minimum": 0,
+                "description": "This is present when the node represents a command invocation. It is a 0-based index into the backtrace commands array."
+              },
+              "parent": {
+                "type": "integer",
+                "minimum": 0,
+                "description": "This is present when the node is not the bottom of the call stack. It is a 0-based index of another node in the backtrace nodes array."
+              }
+            },
+            "additionalProperties": false
+          }
+        },
+        "commands": {
+          "type": "array",
+          "description": "Each list item is a string specifying a command name",
+          "items": {
+            "type": "string"
+          }
+        },
+        "files": {
+          "type": "array",
+          "description": "Each list item is a string specifying the path to a file, represented with forward slashes. If the file is inside the top level source directory, the path is specified relative to that directory. Otherwise, the path is absolute.",
+          "items": {
+            "type": "string"
+          }
+        }
+      },
+      "additionalProperties": false
+    },
+    "codemodelV2_0": {
+      "required": [
+        "name",
+        "id",
+        "type",
+        "paths",
+        "sources",
+        "backtraceGraph"
+      ],
+      "properties": {
+        "name": {
+          "$ref": "#/definitions/name"
+        },
+        "id": {
+          "$ref": "#/definitions/id"
+        },
+        "type": {
+          "$ref": "#/definitions/type"
+        },
+        "backtrace": {
+          "$ref": "#/definitions/backtrace"
+        },
+        "folder": {
+          "$ref": "#/definitions/folder"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "nameOnDisk": {
+          "$ref": "#/definitions/nameOnDisk"
+        },
+        "artifacts": {
+          "$ref": "#/definitions/artifacts"
+        },
+        "isGeneratorProvided": {
+          "$ref": "#/definitions/isGeneratorProvided"
+        },
+        "install": {
+          "$ref": "#/definitions/install"
+        },
+        "link": {
+          "$ref": "#/definitions/link"
+        },
+        "archive": {
+          "$ref": "#/definitions/archive"
+        },
+        "dependencies": {
+          "$ref": "#/definitions/dependencies"
+        },
+        "sources": {
+          "$ref": "#/definitions/sourcesV2_0"
+        },
+        "sourceGroups": {
+          "$ref": "#/definitions/sourceGroups"
+        },
+        "compileGroups": {
+          "$ref": "#/definitions/compileGroupsV2_0"
+        },
+        "backtraceGraph": {
+          "$ref": "#/definitions/backtraceGraph"
+        }
+      },
+      "additionalProperties": false
+    },
+    "codemodelV2_1": {
+      "required": [
+        "name",
+        "id",
+        "type",
+        "paths",
+        "sources",
+        "backtraceGraph"
+      ],
+      "properties": {
+        "name": {
+          "$ref": "#/definitions/name"
+        },
+        "id": {
+          "$ref": "#/definitions/id"
+        },
+        "type": {
+          "$ref": "#/definitions/type"
+        },
+        "backtrace": {
+          "$ref": "#/definitions/backtrace"
+        },
+        "folder": {
+          "$ref": "#/definitions/folder"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "nameOnDisk": {
+          "$ref": "#/definitions/nameOnDisk"
+        },
+        "artifacts": {
+          "$ref": "#/definitions/artifacts"
+        },
+        "isGeneratorProvided": {
+          "$ref": "#/definitions/isGeneratorProvided"
+        },
+        "install": {
+          "$ref": "#/definitions/install"
+        },
+        "link": {
+          "$ref": "#/definitions/link"
+        },
+        "archive": {
+          "$ref": "#/definitions/archive"
+        },
+        "dependencies": {
+          "$ref": "#/definitions/dependencies"
+        },
+        "sources": {
+          "$ref": "#/definitions/sourcesV2_0"
+        },
+        "sourceGroups": {
+          "$ref": "#/definitions/sourceGroups"
+        },
+        "compileGroups": {
+          "$ref": "#/definitions/compileGroupsV2_1"
+        },
+        "backtraceGraph": {
+          "$ref": "#/definitions/backtraceGraph"
+        }
+      },
+      "additionalProperties": false
+    },
+    "codemodelV2_2": {
+      "required": [
+        "name",
+        "id",
+        "type",
+        "paths",
+        "sources",
+        "backtraceGraph"
+      ],
+      "properties": {
+        "name": {
+          "$ref": "#/definitions/name"
+        },
+        "id": {
+          "$ref": "#/definitions/id"
+        },
+        "type": {
+          "$ref": "#/definitions/type"
+        },
+        "backtrace": {
+          "$ref": "#/definitions/backtrace"
+        },
+        "folder": {
+          "$ref": "#/definitions/folder"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "nameOnDisk": {
+          "$ref": "#/definitions/nameOnDisk"
+        },
+        "artifacts": {
+          "$ref": "#/definitions/artifacts"
+        },
+        "isGeneratorProvided": {
+          "$ref": "#/definitions/isGeneratorProvided"
+        },
+        "install": {
+          "$ref": "#/definitions/install"
+        },
+        "link": {
+          "$ref": "#/definitions/link"
+        },
+        "archive": {
+          "$ref": "#/definitions/archive"
+        },
+        "dependencies": {
+          "$ref": "#/definitions/dependencies"
+        },
+        "sources": {
+          "$ref": "#/definitions/sourcesV2_0"
+        },
+        "sourceGroups": {
+          "$ref": "#/definitions/sourceGroups"
+        },
+        "compileGroups": {
+          "$ref": "#/definitions/compileGroupsV2_2"
+        },
+        "backtraceGraph": {
+          "$ref": "#/definitions/backtraceGraph"
+        }
+      },
+      "additionalProperties": false
+    },
+    "codemodelV2_5": {
+      "required": [
+        "name",
+        "id",
+        "type",
+        "paths",
+        "sources",
+        "backtraceGraph"
+      ],
+      "properties": {
+        "name": {
+          "$ref": "#/definitions/name"
+        },
+        "id": {
+          "$ref": "#/definitions/id"
+        },
+        "type": {
+          "$ref": "#/definitions/type"
+        },
+        "backtrace": {
+          "$ref": "#/definitions/backtrace"
+        },
+        "folder": {
+          "$ref": "#/definitions/folder"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "nameOnDisk": {
+          "$ref": "#/definitions/nameOnDisk"
+        },
+        "artifacts": {
+          "$ref": "#/definitions/artifacts"
+        },
+        "isGeneratorProvided": {
+          "$ref": "#/definitions/isGeneratorProvided"
+        },
+        "install": {
+          "$ref": "#/definitions/install"
+        },
+        "link": {
+          "$ref": "#/definitions/link"
+        },
+        "archive": {
+          "$ref": "#/definitions/archive"
+        },
+        "dependencies": {
+          "$ref": "#/definitions/dependencies"
+        },
+        "fileSets": {
+          "$ref": "#/definitions/fileSetsV2_5"
+        },
+        "sources": {
+          "$ref": "#/definitions/sourcesV2_5"
+        },
+        "sourceGroups": {
+          "$ref": "#/definitions/sourceGroups"
+        },
+        "compileGroups": {
+          "$ref": "#/definitions/compileGroupsV2_2"
+        },
+        "backtraceGraph": {
+          "$ref": "#/definitions/backtraceGraph"
+        }
+      },
+      "additionalProperties": false
+    },
+    "codemodelV2_6": {
+      "required": [
+        "name",
+        "id",
+        "type",
+        "paths",
+        "sources",
+        "backtraceGraph"
+      ],
+      "properties": {
+        "name": {
+          "$ref": "#/definitions/name"
+        },
+        "id": {
+          "$ref": "#/definitions/id"
+        },
+        "type": {
+          "$ref": "#/definitions/type"
+        },
+        "backtrace": {
+          "$ref": "#/definitions/backtrace"
+        },
+        "folder": {
+          "$ref": "#/definitions/folder"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "nameOnDisk": {
+          "$ref": "#/definitions/nameOnDisk"
+        },
+        "artifacts": {
+          "$ref": "#/definitions/artifacts"
+        },
+        "isGeneratorProvided": {
+          "$ref": "#/definitions/isGeneratorProvided"
+        },
+        "install": {
+          "$ref": "#/definitions/install"
+        },
+        "link": {
+          "$ref": "#/definitions/link"
+        },
+        "archive": {
+          "$ref": "#/definitions/archive"
+        },
+        "dependencies": {
+          "$ref": "#/definitions/dependencies"
+        },
+        "fileSets": {
+          "$ref": "#/definitions/fileSetsV2_5"
+        },
+        "sources": {
+          "$ref": "#/definitions/sourcesV2_5"
+        },
+        "sourceGroups": {
+          "$ref": "#/definitions/sourceGroups"
+        },
+        "compileGroups": {
+          "$ref": "#/definitions/compileGroupsV2_6"
+        },
+        "backtraceGraph": {
+          "$ref": "#/definitions/backtraceGraph"
+        }
+      },
+      "additionalProperties": false
+    },
+    "codemodelV2_7": {
+      "required": [
+        "name",
+        "id",
+        "type",
+        "paths",
+        "sources",
+        "backtraceGraph"
+      ],
+      "properties": {
+        "name": {
+          "$ref": "#/definitions/name"
+        },
+        "id": {
+          "$ref": "#/definitions/id"
+        },
+        "type": {
+          "$ref": "#/definitions/type"
+        },
+        "backtrace": {
+          "$ref": "#/definitions/backtrace"
+        },
+        "folder": {
+          "$ref": "#/definitions/folder"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "nameOnDisk": {
+          "$ref": "#/definitions/nameOnDisk"
+        },
+        "artifacts": {
+          "$ref": "#/definitions/artifacts"
+        },
+        "isGeneratorProvided": {
+          "$ref": "#/definitions/isGeneratorProvided"
+        },
+        "install": {
+          "$ref": "#/definitions/install"
+        },
+        "launchers": {
+          "$ref": "#/definitions/launchersV2_7"
+        },
+        "link": {
+          "$ref": "#/definitions/link"
+        },
+        "archive": {
+          "$ref": "#/definitions/archive"
+        },
+        "dependencies": {
+          "$ref": "#/definitions/dependencies"
+        },
+        "fileSets": {
+          "$ref": "#/definitions/fileSetsV2_5"
+        },
+        "sources": {
+          "$ref": "#/definitions/sourcesV2_5"
+        },
+        "sourceGroups": {
+          "$ref": "#/definitions/sourceGroups"
+        },
+        "compileGroups": {
+          "$ref": "#/definitions/compileGroupsV2_6"
+        },
+        "backtraceGraph": {
+          "$ref": "#/definitions/backtraceGraph"
+        }
+      },
+      "additionalProperties": false
+    },
+    "codemodelV2_8": {
+      "required": [
+        "name",
+        "id",
+        "type",
+        "paths",
+        "sources",
+        "backtraceGraph"
+      ],
+      "properties": {
+        "name": {
+          "$ref": "#/definitions/name"
+        },
+        "id": {
+          "$ref": "#/definitions/id"
+        },
+        "type": {
+          "$ref": "#/definitions/type"
+        },
+        "backtrace": {
+          "$ref": "#/definitions/backtrace"
+        },
+        "folder": {
+          "$ref": "#/definitions/folder"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "nameOnDisk": {
+          "$ref": "#/definitions/nameOnDisk"
+        },
+        "artifacts": {
+          "$ref": "#/definitions/artifacts"
+        },
+        "isGeneratorProvided": {
+          "$ref": "#/definitions/isGeneratorProvided"
+        },
+        "install": {
+          "$ref": "#/definitions/install"
+        },
+        "launchers": {
+          "$ref": "#/definitions/launchersV2_7"
+        },
+        "link": {
+          "$ref": "#/definitions/link"
+        },
+        "archive": {
+          "$ref": "#/definitions/archive"
+        },
+        "debugger": {
+          "$ref": "#/definitions/debuggerV2_8"
+        },
+        "dependencies": {
+          "$ref": "#/definitions/dependencies"
+        },
+        "fileSets": {
+          "$ref": "#/definitions/fileSetsV2_5"
+        },
+        "sources": {
+          "$ref": "#/definitions/sourcesV2_5"
+        },
+        "sourceGroups": {
+          "$ref": "#/definitions/sourceGroups"
+        },
+        "compileGroups": {
+          "$ref": "#/definitions/compileGroupsV2_6"
+        },
+        "backtraceGraph": {
+          "$ref": "#/definitions/backtraceGraph"
+        }
+      },
+      "additionalProperties": false
+    },
+    "codemodelV2_9": {
+      "required": [
+        "codemodelVersion",
+        "name",
+        "id",
+        "type",
+        "paths",
+        "sources",
+        "backtraceGraph"
+      ],
+      "properties": {
+        "codemodelVersion": {
+          "$ref": "#/definitions/codemodelVersionV2_9"
+        },
+        "name": {
+          "$ref": "#/definitions/name"
+        },
+        "id": {
+          "$ref": "#/definitions/id"
+        },
+        "type": {
+          "$ref": "#/definitions/type"
+        },
+        "backtrace": {
+          "$ref": "#/definitions/backtrace"
+        },
+        "folder": {
+          "$ref": "#/definitions/folder"
+        },
+        "paths": {
+          "$ref": "#/definitions/paths"
+        },
+        "nameOnDisk": {
+          "$ref": "#/definitions/nameOnDisk"
+        },
+        "artifacts": {
+          "$ref": "#/definitions/artifacts"
+        },
+        "isGeneratorProvided": {
+          "$ref": "#/definitions/isGeneratorProvided"
+        },
+        "install": {
+          "$ref": "#/definitions/install"
+        },
+        "launchers": {
+          "$ref": "#/definitions/launchersV2_7"
+        },
+        "link": {
+          "$ref": "#/definitions/link"
+        },
+        "archive": {
+          "$ref": "#/definitions/archive"
+        },
+        "debugger": {
+          "$ref": "#/definitions/debuggerV2_8"
+        },
+        "dependencies": {
+          "$ref": "#/definitions/dependencies"
+        },
+        "fileSets": {
+          "$ref": "#/definitions/fileSetsV2_5"
+        },
+        "sources": {
+          "$ref": "#/definitions/sourcesV2_5"
+        },
+        "sourceGroups": {
+          "$ref": "#/definitions/sourceGroups"
+        },
+        "compileGroups": {
+          "$ref": "#/definitions/compileGroupsV2_6"
+        },
+        "backtraceGraph": {
+          "$ref": "#/definitions/backtraceGraph"
+        }
+      },
+      "additionalProperties": false
+    }
+  }
+}

+ 117 - 0
Help/manual/file_api/schema_toolchains.json

@@ -0,0 +1,117 @@
+{
+  "$schema": "http://json-schema.org/draft-07/schema#",
+  "description": "Schema for the CMake toolchains object kind",
+  "type": "object",
+  "required": [
+    "kind",
+    "version",
+    "toolchains"
+  ],
+  "properties": {
+    "kind": {
+      "type": "string",
+      "const": "toolchains",
+      "description": "Specifies the object kind"
+    },
+    "version": {
+      "type": "object",
+      "required": [
+        "major",
+        "minor"
+      ],
+      "properties": {
+        "major": {
+          "type": "integer",
+          "const": 1
+        },
+        "minor": {
+          "type": "integer",
+          "const": 0
+        }
+      },
+      "additionalProperties": false
+    },
+    "toolchains": {
+      "type": "array",
+      "description": "Array of toolchain configurations per language",
+      "items": {
+        "type": "object",
+        "required": [
+          "language",
+          "compiler"
+        ],
+        "properties": {
+          "language": {
+            "type": "string",
+            "description": "Toolchain language identifier (e.g. C, CXX)"
+          },
+          "compiler": {
+            "type": "object",
+            "properties": {
+              "path": {
+                "type": "string",
+                "description": "Path to the compiler executable. This is present when the CMAKE_<LANG>_COMPILER variable is defined."
+              },
+              "id": {
+                "type": "string",
+                "description": "Compiler identifier (e.g. GNU, MSVC). This is present when the CMAKE_<LANG>_COMPILER_ID variable is defined."
+              },
+              "version": {
+                "type": "string",
+                "description": "Version of the compiler. This is present when the CMAKE_<LANG>_COMPILER_VERSION variable is defined."
+              },
+              "target": {
+                "type": "string",
+                "description": "Cross-compiling target of the compiler. This is present when the CMAKE_<LANG>_COMPILER_TARGET variable is defined."
+              },
+              "implicit": {
+                "type": "object",
+                "properties": {
+                  "includeDirectories": {
+                    "type": "array",
+                    "items": {
+                      "type": "string"
+                    },
+                    "description": "List of implicit include directories for the compiler. This is present when the CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES variable is defined."
+                  },
+                  "linkDirectories": {
+                    "type": "array",
+                    "items": {
+                      "type": "string"
+                    },
+                    "description": "List of implicit link directories for the compiler front end. This is present when the CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES variable is defined."
+                  },
+                  "linkFrameworkDirectories": {
+                    "type": "array",
+                    "items": {
+                      "type": "string"
+                    },
+                    "description": "List of implicit link framework directories for the compiler front end. This is present when the CMAKE_<LANG>_IMPLICIT_FRAMEWORK_DIRECTORIES variable is defined."
+                  },
+                  "linkLibraries": {
+                    "type": "array",
+                    "items": {
+                      "type": "string"
+                    },
+                    "description": "List of implicit link libraries for the compiler front end. This is present when the CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES variable is defined."
+                  }
+                },
+                "additionalProperties": false
+              }
+            },
+            "additionalProperties": false
+          },
+          "sourceFileExtensions": {
+            "type": "array",
+            "items": {
+              "type": "string"
+            },
+            "description": "List of source file extensions (without leading dot) supported by this toolchain"
+          }
+        },
+        "additionalProperties": false
+      }
+    }
+  },
+  "additionalProperties": false
+}

+ 2 - 1
Tests/RunCMake/CMakeLists.txt

@@ -420,7 +420,8 @@ if(CMAKE_USE_SYSTEM_JSONCPP)
   list(APPEND FileAPI_ARGS -DJsonCpp_VERSION_STRING=${JsonCpp_VERSION_STRING})
 endif()
 add_RunCMake_test(FileAPI -DPython_EXECUTABLE=${Python_EXECUTABLE}
-                          -DCMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID})
+                          -DCMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID}
+                          -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA})
 if(CMAKE_GENERATOR MATCHES "Make|Ninja")
   add_RunCMake_test(Instrumentation)
 endif()

+ 9 - 0
Tests/RunCMake/FileAPI/ClientStateful-check.cmake

@@ -65,4 +65,13 @@ set(expect
   )
 check_api("^${expect}$")
 
+check_stateful_queries(
+  request-version-1
+  request-version-1-1
+  request-version-2
+  request-array-version-1
+  request-array-version-1-1
+  request-array-version-2
+)
+
 check_python(ClientStateful index)

+ 86 - 1
Tests/RunCMake/FileAPI/RunCMakeTest.cmake

@@ -1,5 +1,33 @@
 include(RunCMake)
 
+cmake_policy(SET CMP0140 NEW)
+
+# Arguments after the first are the files to validate against the schema
+function(validate_fileapi_schema schema)
+  if(NOT ARGN)
+    # No files to validate against the schema
+    return()
+  endif()
+  list(JOIN ARGN "\n" file_list)
+  set(file_list_file ${RunCMake_TEST_BINARY_DIR}/check_file_list.txt)
+  file(WRITE "${file_list_file}" "${file_list}")
+  execute_process(
+    COMMAND ${Python_EXECUTABLE}
+      "${RunCMake_SOURCE_DIR}/fileapi_validate_schema.py"
+        "${file_list_file}"
+        "${schema}"
+    RESULT_VARIABLE result
+    OUTPUT_VARIABLE output
+    ERROR_VARIABLE output
+  )
+  if(NOT result STREQUAL 0)
+    string(REPLACE "\n" "\n  " output "${output}")
+    string(APPEND RunCMake_TEST_FAILED
+      "Failed to validate files against JSON schema: ${schema}\nOutput:\n${output}\n")
+  endif()
+  return(PROPAGATE RunCMake_TEST_FAILED)
+endfunction()
+
 # Function called in *-check.cmake scripts to check api files.
 function(check_api expect)
   file(GLOB_RECURSE actual
@@ -13,8 +41,65 @@ function(check_api expect)
 do not match what we expected:
   ${expect}
 in directory:
-  ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1" PARENT_SCOPE)
+  ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1")
+  endif()
+  if(NOT RunCMake_TEST_FAILED AND Python_EXECUTABLE AND CMake_TEST_JSON_SCHEMA)
+    cmake_path(SET schema_dir NORMALIZE ${RunCMake_SOURCE_DIR}/../../../Help/manual/file_api)
+    set(prefix ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1)
+    set(replies ${actual})
+    list(FILTER replies INCLUDE REGEX "^reply/")
+    set(schema_types
+      index   # Special case, error replies also use this schema
+      codemodel
+      directory
+      target
+      configureLog
+      cache
+      cmakeFiles
+      toolchains
+    )
+    foreach(schema_type IN LISTS schema_types)
+      set(schema_type_${schema_type} "")
+    endforeach()
+    foreach(file IN LISTS replies)
+      if(file MATCHES "^reply/(index|error)-")
+        list(APPEND schema_type_index ${prefix}/${file})
+      else()
+        foreach(schema_type IN LISTS schema_types)
+          if(file MATCHES "^reply/${schema_type}-")
+            list(APPEND schema_type_${schema_type} ${prefix}/${file})
+          endif()
+        endforeach()
+      endif()
+    endforeach()
+    foreach(schema_type IN LISTS schema_types)
+      validate_fileapi_schema(
+        ${schema_dir}/schema_${schema_type}.json
+        ${schema_type_${schema_type}}
+      )
+    endforeach()
+  endif()
+  return(PROPAGATE RunCMake_TEST_FAILED)
+endfunction()
+
+function(check_stateful_queries)
+  if(RunCMake_TEST_FAILED OR NOT Python_EXECUTABLE OR NOT CMake_TEST_JSON_SCHEMA)
+    return()
   endif()
+
+  cmake_path(SET schema_dir NORMALIZE
+    ${RunCMake_SOURCE_DIR}/../../../Help/manual/file_api
+  )
+  set(prefix ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client)
+  list(TRANSFORM ARGN
+    REPLACE "^(.+)$" "${prefix}-\\1/query.json"
+    OUTPUT_VARIABLE query_json_files
+  )
+  validate_fileapi_schema(
+    ${schema_dir}/schema_stateful_query.json
+    ${query_json_files}
+  )
+  return(PROPAGATE RunCMake_TEST_FAILED)
 endfunction()
 
 function(check_python case prefix)

+ 2 - 0
Tests/RunCMake/FileAPI/cache-v2-ClientStateful-check.cmake

@@ -8,4 +8,6 @@ set(expect
   )
 check_api("^${expect}$")
 
+check_stateful_queries(foo)
+
 check_python(cache-v2 index)

+ 2 - 0
Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake

@@ -8,4 +8,6 @@ set(expect
   )
 check_api("^${expect}$")
 
+check_stateful_queries(foo)
+
 check_python(cmakeFiles-v1 index)

+ 2 - 0
Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-check.cmake

@@ -10,4 +10,6 @@ set(expect
   )
 check_api("^${expect}$")
 
+check_stateful_queries(foo)
+
 check_python(codemodel-v2 index)

+ 2 - 0
Tests/RunCMake/FileAPI/configureLog-v1-ClientStateful-check.cmake

@@ -8,4 +8,6 @@ set(expect
   )
 check_api("^${expect}$")
 
+check_stateful_queries(foo)
+
 check_python(configureLog-v1 index)

+ 23 - 0
Tests/RunCMake/FileAPI/fileapi_validate_schema.py

@@ -0,0 +1,23 @@
+import json
+import jsonschema
+import sys
+
+
+# First argument is a file containing the list of files to check
+with open(sys.argv[1], "r", encoding="utf-8") as file_list:
+    files_to_check = [line.strip() for line in file_list if line.strip()]
+
+# Second argument is the schema file
+with open(sys.argv[2], "r", encoding="utf-8-sig") as f:
+    schema = json.load(f)
+
+# Check each file against the schema
+for file_path in files_to_check:
+    try:
+        with open(file_path, "r", encoding="utf-8-sig") as f:
+            contents = json.load(f)
+        # The following raises an exception if validation fails
+        jsonschema.validate(contents, schema)
+    except Exception as e:
+        print(f"Failed to validate file {file_path}: {e}")
+        raise

+ 2 - 0
Tests/RunCMake/FileAPI/toolchains-v1-ClientStateful-check.cmake

@@ -8,4 +8,6 @@ set(expect
   )
 check_api("^${expect}$")
 
+check_stateful_queries(foo)
+
 check_python(toolchains-v1 index)