summaryrefslogtreecommitdiffstats
path: root/Help/manual/presets/schema.json
blob: 564c94c39414388f4a046e0c4ecb59e484279475 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "description": "The presets specify the generator and the build directory, and optionally a list of variables and other arguments to pass to CMake.",
  "properties": {
    "version": {
      "type": "integer",
      "description": "A required integer representing the version of the JSON schema. Currently, the only supported version is 1.",
      "minimum": 1,
      "maximum": 1
    },
    "cmakeMinimumRequired": {
      "type": "object",
      "description": "An optional object representing the minimum version of CMake needed to build this project.",
      "properties": {
        "major": {
          "type": "integer",
          "description": "An optional integer representing the major version."
        },
        "minor": {
          "type": "integer",
          "description": "An optional integer representing the minor version."
        },
        "patch": {
          "type": "integer",
          "description": "An optional integer representing the patch version."
        }
      },
      "additionalProperties": false
    },
    "vendor": {
      "type": "object",
      "description": "An optional map containing vendor-specific information. CMake does not interpret the contents of this field except to verify that it is a map if it does exist. However, the keys should be a vendor-specific domain name followed by a /-separated path. For example, the Example IDE 1.0 could use example.com/ExampleIDE/1.0. The value of each field can be anything desired by the vendor, though will typically be a map.",
      "properties": {}
    },
    "configurePresets": {
      "type": "array",
      "description": "An optional array of configure preset objects.",
      "items": {
        "type": "object",
        "description": "A configure preset object.",
        "properties": {
          "name": {
            "type": "string",
            "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
            "minLength": 1
          },
          "hidden": {
            "type": "boolean",
            "description": "An optional boolean specifying whether or not a preset should be hidden. If a preset is hidden, it cannot be used in the --preset= argument, will not show up in the CMake GUI, and does not have to have a valid generator or binaryDir, even from inheritance. hidden presets are intended to be used as a base for other presets to inherit via the inherits field."
          },
          "inherits": {
            "anyOf": [
              {
                "type": "string",
                "description": "An optional string representing the name of the preset to inherit from.",
                "minLength": 1
              },
              {
                "type": "array",
                "description": "An optional array of strings representing the names of presets to inherit from. The preset will inherit all of the fields from the inherits presets by default (except name, hidden, inherits, description, and longDescription), but can override them as desired. If multiple inherits presets provide conflicting values for the same field, the earlier preset in the inherits list will be preferred. Presets in CMakePresets.json may not inherit from presets in CMakeUserPresets.json.",
                "items": {
                  "type": "string",
                  "description": "An optional string representing the name of the preset to inherit from.",
                  "minLength": 1
                }
              }
            ]
          },
          "vendor": {
            "type": "object",
            "description": "An optional map containing vendor-specific information. CMake does not interpret the contents of this field except to verify that it is a map if it does exist. However, it should follow the same conventions as the root-level vendor field. If vendors use their own per-preset vendor field, they should implement inheritance in a sensible manner when appropriate.",
            "properties": {}
          },
          "displayName": {
            "type": "string",
            "description": "An optional string with a human-friendly name of the preset."
          },
          "description": {
            "type": "string",
            "description": "An optional string with a human-friendly description of the preset."
          },
          "generator": {
            "type": "string",
            "description": "An optional string representing the generator to use for the preset. If generator is not specified, it must be inherited from the inherits preset (unless this preset is hidden). Note that for Visual Studio generators, unlike in the command line -G argument, you cannot include the platform name in the generator name. Use the architecture field instead."
          },
          "architecture": {
            "type": "string",
            "description": "An optional string representing the platform name to use for Visual Studio generators."
          },
          "toolset": {
            "type": "string",
            "description": "An optional string representing the toolset name to use for Visual Studio generators."
          },
          "cmakeGeneratorConfig": {
            "type": "string",
            "description": "An optional string telling CMake how to handle the architecture and toolset fields. Valid values are: \"default\": Set the platform and toolset using the architecture and toolset fields respectively. On non-Visual Studio generators, this will result in an error if architecture or toolset are set. \"ignore\": Do not set the platform or toolset at all, even on Visual Studio generators. This is useful if, for example, a preset uses the Ninja generator, and an IDE knows how to set up the Visual C++ environment from the architecture and toolset fields. In that case, CMake will ignore architecture and toolset, but the IDE can use them to set up the environment before invoking CMake.",
            "enum": [
              "default",
              "ignore"
            ]
          },
          "binaryDir": {
            "type": "string",
            "description": "An optional string representing the path to the output binary directory. This field supports macro expansion. If a relative path is specified, it is calculated relative to the source directory. If binaryDir is not specified, it must be inherited from the inherits preset (unless this preset is hidden)."
          },
          "cmakeExecutable": {
            "type": "string",
            "description": "An optional string representing the path to the CMake executable to use for this preset. This is reserved for use by IDEs, and is not used by CMake itself. IDEs that use this field should expand any macros in it."
          },
          "cacheVariables": {
            "type": "object",
            "description": "An optional map of cache variables. The key is the variable name (which must not be an empty string). Cache variables are inherited through the inherits field, and the preset's variables will be the union of its own cacheVariables and the cacheVariables from all its parents. If multiple presets in this union define the same variable, the standard rules of inherits are applied.",
            "properties": {},
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "null",
                  "description": "Setting a variable to null causes it to not be set, even if a value was inherited from another preset."
                },
                {
                  "type": "string",
                  "description": "A string representing the value of the variable (which supports macro expansion)."
                },
                {
                  "type": "object",
                  "description": "An object representing the type and value of the variable.",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "An optional string representing the type of the variable. It should be BOOL, FILEPATH, PATH, STRING, or INTERNAL."
                    },
                    "value": {
                      "type": "string",
                      "description": "A required string representing the value of the variable. This field supports macro expansion."
                    }
                  },
                  "required": [
                    "value"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "propertyNames": {
              "pattern": "^.+$"
            }
          },
          "environment": {
            "type": "object",
            "description": "An optional map of environment variables. The key is the variable name (which must not be an empty string). Each variable is set regardless of whether or not a value was given to it by the process's environment. This field supports macro expansion, and environment variables in this map may reference each other, and may be listed in any order, as long as such references do not cause a cycle (for example,if ENV_1 is $env{ENV_2}, ENV_2 may not be $env{ENV_1}.) Environment variables are inherited through the inherits field, and the preset's environment will be the union of its own environment and the environment from all its parents. If multiple presets in this union define the same variable, the standard rules of inherits are applied. Setting a variable to null causes it to not be set, even if a value was inherited from another preset.",
            "properties": {},
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "null",
                  "description": "Setting a variable to null causes it to not be set, even if a value was inherited from another preset."
                },
                {
                  "type": "string",
                  "description": "A string representing the value of the variable."
                }
              ]
            },
            "propertyNames": {
              "pattern": "^.+$"
            }
          },
          "warnings": {
            "type": "object",
            "description": "An optional object specifying warnings.",
            "properties": {
              "dev": {
                "type": "boolean",
                "description": "An optional boolean. Equivalent to passing -Wdev or -Wno-dev on the command line. This may not be set to false if errors.dev is set to true."
              },
              "deprecated": {
                "type": "boolean",
                "description": "An optional boolean. Equivalent to passing -Wdeprecated or -Wno-deprecated on the command line. This may not be set to false if errors.deprecated is set to true."
              },
              "uninitialized": {
                "type": "boolean",
                "description": "An optional boolean. Setting this to true is equivalent to passing --warn-uninitialized on the command line."
              },
              "unusedCli": {
                "type": "boolean",
                "description": "An optional boolean. Setting this to false is equivalent to passing --no-warn-unused-cli on the command line."
              },
              "systemVars": {
                "type": "boolean",
                "description": "An optional boolean. Setting this to true is equivalent to passing --check-system-vars on the command line."
              }
            },
            "additionalProperties": false
          },
          "errors": {
            "type": "object",
            "description": "An optional object specifying errors.",
            "properties": {
              "dev": {
                "type": "boolean",
                "description": "An optional boolean. Equivalent to passing -Werror=dev or -Wno-error=dev on the command line. This may not be set to true if warnings.dev is set to false."
              },
              "deprecated": {
                "type": "boolean",
                "description": "An optional boolean. Equivalent to passing -Werror=deprecated or -Wno-error=deprecated on the command line. This may not be set to true if warnings.deprecated is set to false."
              }
            },
            "additionalProperties": false
          },
          "debug": {
            "type": "object",
            "description": "An optional object specifying debug options.",
            "properties": {
              "output": {
                "type": "boolean",
                "description": "An optional boolean. Setting this to true is equivalent to passing --debug-output on the command line."
              },
              "tryCompile": {
                "type": "boolean",
                "description": "An optional boolean. Setting this to true is equivalent to passing --debug-trycompile on the command line."
              },
              "find": {
                "type": "boolean",
                "description": "An optional boolean. Setting this to true is equivalent to passing --debug-find on the command line."
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "version"
  ],
  "additionalProperties": false
}