cmake-presets.7.rst 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258
  1. .. cmake-manual-description: CMakePresets.json
  2. cmake-presets(7)
  3. ****************
  4. .. only:: html
  5. .. contents::
  6. Introduction
  7. ============
  8. .. versionadded:: 3.19
  9. One problem that CMake users often face is sharing settings with other people
  10. for common ways to configure a project. This may be done to support CI builds,
  11. or for users who frequently use the same build. CMake supports two main files,
  12. ``CMakePresets.json`` and ``CMakeUserPresets.json``, that allow users to
  13. specify common configure options and share them with others. CMake also
  14. supports files included with the ``include`` field.
  15. ``CMakePresets.json`` and ``CMakeUserPresets.json`` live in the project's root
  16. directory. They both have exactly the same format, and both are optional
  17. (though at least one must be present if :option:`--preset <cmake --preset>`
  18. is specified). ``CMakePresets.json`` is meant to specify project-wide build
  19. details, while ``CMakeUserPresets.json`` is meant for developers to specify
  20. their own local build details.
  21. ``CMakePresets.json`` may be checked into a version control system, and
  22. ``CMakeUserPresets.json`` should NOT be checked in. For example, if a
  23. project is using Git, ``CMakePresets.json`` may be tracked, and
  24. ``CMakeUserPresets.json`` should be added to the ``.gitignore``.
  25. Format
  26. ======
  27. The files are a JSON document with an object as the root:
  28. .. literalinclude:: presets/example.json
  29. :language: json
  30. The root object recognizes the following fields:
  31. ``version``
  32. A required integer representing the version of the JSON schema.
  33. The supported versions are:
  34. ``1``
  35. .. versionadded:: 3.19
  36. ``2``
  37. .. versionadded:: 3.20
  38. ``3``
  39. .. versionadded:: 3.21
  40. ``4``
  41. .. versionadded:: 3.23
  42. ``5``
  43. .. versionadded:: 3.24
  44. ``6``
  45. .. versionadded:: 3.25
  46. ``7``
  47. .. versionadded:: 3.27
  48. ``cmakeMinimumRequired``
  49. An optional object representing the minimum version of CMake needed to
  50. build this project. This object consists of the following fields:
  51. ``major``
  52. An optional integer representing the major version.
  53. ``minor``
  54. An optional integer representing the minor version.
  55. ``patch``
  56. An optional integer representing the patch version.
  57. ``include``
  58. An optional array of strings representing files to include. If the filenames
  59. are not absolute, they are considered relative to the current file.
  60. This is allowed in preset files specifying version ``4`` or above.
  61. See `Includes`_ for discussion of the constraints on included files.
  62. ``vendor``
  63. An optional map containing vendor-specific information. CMake does not
  64. interpret the contents of this field except to verify that it is a map if
  65. it does exist. However, the keys should be a vendor-specific domain name
  66. followed by a ``/``-separated path. For example, the Example IDE 1.0 could
  67. use ``example.com/ExampleIDE/1.0``. The value of each field can be anything
  68. desired by the vendor, though will typically be a map.
  69. ``configurePresets``
  70. An optional array of `Configure Preset`_ objects.
  71. This is allowed in preset files specifying version ``1`` or above.
  72. ``buildPresets``
  73. An optional array of `Build Preset`_ objects.
  74. This is allowed in preset files specifying version ``2`` or above.
  75. ``testPresets``
  76. An optional array of `Test Preset`_ objects.
  77. This is allowed in preset files specifying version ``2`` or above.
  78. ``packagePresets``
  79. An optional array of `Package Preset`_ objects.
  80. This is allowed in preset files specifying version ``6`` or above.
  81. ``workflowPresets``
  82. An optional array of `Workflow Preset`_ objects.
  83. This is allowed in preset files specifying version ``6`` or above.
  84. Includes
  85. ^^^^^^^^
  86. ``CMakePresets.json`` and ``CMakeUserPresets.json`` can include other files
  87. with the ``include`` field in file version ``4`` and later. Files included
  88. by these files can also include other files. If ``CMakePresets.json`` and
  89. ``CMakeUserPresets.json`` are both present, ``CMakeUserPresets.json``
  90. implicitly includes ``CMakePresets.json``, even with no ``include`` field,
  91. in all versions of the format.
  92. If a preset file contains presets that inherit from presets in another file,
  93. the file must include the other file either directly or indirectly.
  94. Include cycles are not allowed among files. If ``a.json`` includes
  95. ``b.json``, ``b.json`` cannot include ``a.json``. However, a file may be
  96. included multiple times from the same file or from different files.
  97. Files directly or indirectly included from ``CMakePresets.json`` should be
  98. guaranteed to be provided by the project. ``CMakeUserPresets.json`` may
  99. include files from anywhere.
  100. Configure Preset
  101. ^^^^^^^^^^^^^^^^
  102. Each entry of the ``configurePresets`` array is a JSON object
  103. that may contain the following fields:
  104. ``name``
  105. A required string representing the machine-friendly name of the preset.
  106. This identifier is used in the :ref:`cmake --preset <CMake Options>` option.
  107. There must not be two configure presets in the union of ``CMakePresets.json``
  108. and ``CMakeUserPresets.json`` in the same directory with the same name.
  109. However, a configure preset may have the same name as a build, test,
  110. package, or workflow preset.
  111. ``hidden``
  112. An optional boolean specifying whether or not a preset should be hidden.
  113. If a preset is hidden, it cannot be used in the ``--preset=`` argument,
  114. will not show up in the :manual:`CMake GUI <cmake-gui(1)>`, and does not
  115. have to have a valid ``generator`` or ``binaryDir``, even from
  116. inheritance. ``hidden`` presets are intended to be used as a base for
  117. other presets to inherit via the ``inherits`` field.
  118. ``inherits``
  119. An optional array of strings representing the names of presets to inherit
  120. from. This field can also be a string, which is equivalent to an array
  121. containing one string.
  122. The preset will inherit all of the fields from the ``inherits``
  123. presets by default (except ``name``, ``hidden``, ``inherits``,
  124. ``description``, and ``displayName``), but can override them as
  125. desired. If multiple ``inherits`` presets provide conflicting values for
  126. the same field, the earlier preset in the ``inherits`` array will be
  127. preferred.
  128. A preset can only inherit from another preset that is defined in the
  129. same file or in one of the files it includes (directly or indirectly).
  130. Presets in ``CMakePresets.json`` may not inherit from presets in
  131. ``CMakeUserPresets.json``.
  132. ``condition``
  133. An optional `Condition`_ object. This is allowed in preset files specifying
  134. version ``3`` or above.
  135. ``vendor``
  136. An optional map containing vendor-specific information. CMake does not
  137. interpret the contents of this field except to verify that it is a map
  138. if it does exist. However, it should follow the same conventions as the
  139. root-level ``vendor`` field. If vendors use their own per-preset
  140. ``vendor`` field, they should implement inheritance in a sensible manner
  141. when appropriate.
  142. ``displayName``
  143. An optional string with a human-friendly name of the preset.
  144. ``description``
  145. An optional string with a human-friendly description of the preset.
  146. ``generator``
  147. An optional string representing the generator to use for the preset. If
  148. ``generator`` is not specified, it must be inherited from the
  149. ``inherits`` preset (unless this preset is ``hidden``). In version ``3``
  150. or above, this field may be omitted to fall back to regular generator
  151. discovery procedure.
  152. Note that for Visual Studio generators, unlike in the command line
  153. :option:`-G <cmake -G>` argument, you cannot include the platform name
  154. in the generator name. Use the ``architecture`` field instead.
  155. ``architecture``, ``toolset``
  156. Optional fields representing the platform and toolset, respectively, for
  157. :manual:`generators <cmake-generators(7)>` that support them.
  158. See :option:`cmake -A` option for possible values for ``architecture``
  159. and :option:`cmake -T` for ``toolset``.
  160. Each may be either a string or an object with the following fields:
  161. ``value``
  162. An optional string representing the value.
  163. ``strategy``
  164. An optional string telling CMake how to handle the ``architecture`` or
  165. ``toolset`` field. Valid values are:
  166. ``"set"``
  167. Set the respective value. This will result in an error for generators
  168. that do not support the respective field.
  169. ``"external"``
  170. Do not set the value, even if the generator supports it. This is
  171. useful if, for example, a preset uses the Ninja generator, and an IDE
  172. knows how to set up the Visual C++ environment from the
  173. ``architecture`` and ``toolset`` fields. In that case, CMake will
  174. ignore the field, but the IDE can use them to set up the environment
  175. before invoking CMake.
  176. If no ``strategy`` field is given, or if the field uses the string form
  177. rather than the object form, the behavior is the same as ``"set"``.
  178. ``toolchainFile``
  179. An optional string representing the path to the toolchain file.
  180. This field supports `macro expansion`_. If a relative path is specified,
  181. it is calculated relative to the build directory, and if not found,
  182. relative to the source directory. This field takes precedence over any
  183. :variable:`CMAKE_TOOLCHAIN_FILE` value. It is allowed in preset files
  184. specifying version ``3`` or above.
  185. ``binaryDir``
  186. An optional string representing the path to the output binary directory.
  187. This field supports `macro expansion`_. If a relative path is specified,
  188. it is calculated relative to the source directory. If ``binaryDir`` is not
  189. specified, it must be inherited from the ``inherits`` preset (unless this
  190. preset is ``hidden``). In version ``3`` or above, this field may be
  191. omitted.
  192. ``installDir``
  193. An optional string representing the path to the installation directory.
  194. This field supports `macro expansion`_. If a relative path is specified,
  195. it is calculated relative to the source directory. This is allowed in
  196. preset files specifying version ``3`` or above.
  197. ``cmakeExecutable``
  198. An optional string representing the path to the CMake executable to use
  199. for this preset. This is reserved for use by IDEs, and is not used by
  200. CMake itself. IDEs that use this field should expand any macros in it.
  201. ``cacheVariables``
  202. An optional map of cache variables. The key is the variable name (which
  203. may not be an empty string), and the value is either ``null``, a boolean
  204. (which is equivalent to a value of ``"TRUE"`` or ``"FALSE"`` and a type
  205. of ``BOOL``), a string representing the value of the variable (which
  206. supports `macro expansion`_), or an object with the following fields:
  207. ``type``
  208. An optional string representing the type of the variable.
  209. ``value``
  210. A required string or boolean representing the value of the variable.
  211. A boolean is equivalent to ``"TRUE"`` or ``"FALSE"``. This field
  212. supports `macro expansion`_.
  213. Cache variables are inherited through the ``inherits`` field, and the
  214. preset's variables will be the union of its own ``cacheVariables`` and
  215. the ``cacheVariables`` from all its parents. If multiple presets in this
  216. union define the same variable, the standard rules of ``inherits`` are
  217. applied. Setting a variable to ``null`` causes it to not be set, even if
  218. a value was inherited from another preset.
  219. ``environment``
  220. An optional map of environment variables. The key is the variable name
  221. (which may not be an empty string), and the value is either ``null`` or
  222. a string representing the value of the variable. Each variable is set
  223. regardless of whether or not a value was given to it by the process's
  224. environment. This field supports `macro expansion`_, and environment
  225. variables in this map may reference each other, and may be listed in any
  226. order, as long as such references do not cause a cycle (for example,
  227. if ``ENV_1`` is ``$env{ENV_2}``, ``ENV_2`` may not be ``$env{ENV_1}``.)
  228. Environment variables are inherited through the ``inherits`` field, and
  229. the preset's environment will be the union of its own ``environment`` and
  230. the ``environment`` from all its parents. If multiple presets in this
  231. union define the same variable, the standard rules of ``inherits`` are
  232. applied. Setting a variable to ``null`` causes it to not be set, even if
  233. a value was inherited from another preset.
  234. ``warnings``
  235. An optional object specifying the warnings to enable. The object may
  236. contain the following fields:
  237. ``dev``
  238. An optional boolean. Equivalent to passing :option:`-Wdev <cmake -Wdev>`
  239. or :option:`-Wno-dev <cmake -Wno-dev>` on the command line. This may not
  240. be set to ``false`` if ``errors.dev`` is set to ``true``.
  241. ``deprecated``
  242. An optional boolean. Equivalent to passing
  243. :option:`-Wdeprecated <cmake -Wdeprecated>` or
  244. :option:`-Wno-deprecated <cmake -Wno-deprecated>` on the command line.
  245. This may not be set to ``false`` if ``errors.deprecated`` is set to
  246. ``true``.
  247. ``uninitialized``
  248. An optional boolean. Setting this to ``true`` is equivalent to passing
  249. :option:`--warn-uninitialized <cmake --warn-uninitialized>` on the command
  250. line.
  251. ``unusedCli``
  252. An optional boolean. Setting this to ``false`` is equivalent to passing
  253. :option:`--no-warn-unused-cli <cmake --no-warn-unused-cli>` on the command
  254. line.
  255. ``systemVars``
  256. An optional boolean. Setting this to ``true`` is equivalent to passing
  257. :option:`--check-system-vars <cmake --check-system-vars>` on the command
  258. line.
  259. ``errors``
  260. An optional object specifying the errors to enable. The object may
  261. contain the following fields:
  262. ``dev``
  263. An optional boolean. Equivalent to passing :option:`-Werror=dev <cmake -Werror>`
  264. or :option:`-Wno-error=dev <cmake -Werror>` on the command line.
  265. This may not be set to ``true`` if ``warnings.dev`` is set to ``false``.
  266. ``deprecated``
  267. An optional boolean. Equivalent to passing
  268. :option:`-Werror=deprecated <cmake -Werror>` or
  269. :option:`-Wno-error=deprecated <cmake -Werror>` on the command line.
  270. This may not be set to ``true`` if ``warnings.deprecated`` is set to
  271. ``false``.
  272. ``debug``
  273. An optional object specifying debug options. The object may contain the
  274. following fields:
  275. ``output``
  276. An optional boolean. Setting this to ``true`` is equivalent to passing
  277. :option:`--debug-output <cmake --debug-output>` on the command line.
  278. ``tryCompile``
  279. An optional boolean. Setting this to ``true`` is equivalent to passing
  280. :option:`--debug-trycompile <cmake --debug-trycompile>` on the command
  281. line.
  282. ``find``
  283. An optional boolean. Setting this to ``true`` is equivalent to passing
  284. :option:`--debug-find <cmake --debug-find>` on the command line.
  285. ``trace``
  286. An optional object specifying trace options. This is allowed in preset
  287. files specifying version ``7``. The object may contain the following fields:
  288. ``mode``
  289. An optional string that specifies the trace mode. Valid values are:
  290. ``on``
  291. Causes a trace of all calls made and from where to be printed.
  292. Equivalent to passing :option:`--trace <cmake --trace>` on the command
  293. line.
  294. ``off``
  295. A trace of all calls will not be printed.
  296. ``expand``
  297. Causes a trace with variables expanded of all calls made and from where
  298. to be printed. Equivalent to passing :option:`--trace-expand <cmake --trace-expand>`
  299. on the command line.
  300. ``format``
  301. An optional string that specifies the format output of the trace.
  302. Valid values are:
  303. ``human``
  304. Prints each trace line in a human-readable format.
  305. This is the default format. Equivalent to passing
  306. :option:`--trace-format=human <cmake --trace-format>`
  307. on the command line.
  308. ``json-v1``
  309. Prints each line as a separate JSON document. Equivalent to passing
  310. :option:`--trace-format=json-v1 <cmake --trace-format>`
  311. on the command line.
  312. ``source``
  313. An optional array of strings representing the paths of source files to
  314. be traced. This field can also be a string, which is equivalent to an
  315. array containing one string. Equivalent to passing
  316. :option:`--trace-source <cmake --trace-source>` on the command line.
  317. ``redirect``
  318. An optional string specifying a path to a trace output file. Equivalent
  319. to passing :option:`--trace-redirect <cmake --trace-redirect>`
  320. on the command line.
  321. Build Preset
  322. ^^^^^^^^^^^^
  323. Each entry of the ``buildPresets`` array is a JSON object
  324. that may contain the following fields:
  325. ``name``
  326. A required string representing the machine-friendly name of the preset.
  327. This identifier is used in the
  328. :ref:`cmake --build --preset <Build Tool Mode>` option.
  329. There must not be two build presets in the union of ``CMakePresets.json``
  330. and ``CMakeUserPresets.json`` in the same directory with the same name.
  331. However, a build preset may have the same name as a configure, test,
  332. package, or workflow preset.
  333. ``hidden``
  334. An optional boolean specifying whether or not a preset should be hidden.
  335. If a preset is hidden, it cannot be used in the
  336. :option:`--preset <cmake --preset>` argument
  337. and does not have to have a valid ``configurePreset``, even from
  338. inheritance. ``hidden`` presets are intended to be used as a base for
  339. other presets to inherit via the ``inherits`` field.
  340. ``inherits``
  341. An optional array of strings representing the names of presets to inherit
  342. from. This field can also be a string, which is equivalent to an array
  343. containing one string.
  344. The preset will inherit all of the fields from the
  345. ``inherits`` presets by default (except ``name``, ``hidden``,
  346. ``inherits``, ``description``, and ``displayName``), but can override
  347. them as desired. If multiple ``inherits`` presets provide conflicting
  348. values for the same field, the earlier preset in the ``inherits`` array
  349. will be preferred.
  350. A preset can only inherit from another preset that is defined in the
  351. same file or in one of the files it includes (directly or indirectly).
  352. Presets in ``CMakePresets.json`` may not inherit from presets in
  353. ``CMakeUserPresets.json``.
  354. ``condition``
  355. An optional `Condition`_ object. This is allowed in preset files specifying
  356. version ``3`` or above.
  357. ``vendor``
  358. An optional map containing vendor-specific information. CMake does not
  359. interpret the contents of this field except to verify that it is a map
  360. if it does exist. However, it should follow the same conventions as the
  361. root-level ``vendor`` field. If vendors use their own per-preset
  362. ``vendor`` field, they should implement inheritance in a sensible manner
  363. when appropriate.
  364. ``displayName``
  365. An optional string with a human-friendly name of the preset.
  366. ``description``
  367. An optional string with a human-friendly description of the preset.
  368. ``environment``
  369. An optional map of environment variables. The key is the variable name
  370. (which may not be an empty string), and the value is either ``null`` or
  371. a string representing the value of the variable. Each variable is set
  372. regardless of whether or not a value was given to it by the process's
  373. environment. This field supports macro expansion, and environment
  374. variables in this map may reference each other, and may be listed in any
  375. order, as long as such references do not cause a cycle (for example, if
  376. ``ENV_1`` is ``$env{ENV_2}``, ``ENV_2`` may not be ``$env{ENV_1}``.)
  377. Environment variables are inherited through the ``inherits`` field, and
  378. the preset's environment will be the union of its own ``environment``
  379. and the ``environment`` from all its parents. If multiple presets in
  380. this union define the same variable, the standard rules of ``inherits``
  381. are applied. Setting a variable to ``null`` causes it to not be set,
  382. even if a value was inherited from another preset.
  383. .. note::
  384. For a CMake project using ExternalProject with a configuration preset
  385. having environment variables needed in the ExternalProject, use a build
  386. preset that inherits that configuration preset or the ExternalProject
  387. will not have the environment variables set in the configuration preset.
  388. Example: suppose the host defaults to one compiler (say Clang)
  389. and the user wishes to use another compiler (say GCC). Set configuration
  390. preset environment variables ``CC`` and ``CXX`` and use a build preset
  391. that inherits that configuration preset. Otherwise the ExternalProject
  392. may use a different (system default) compiler than the top-level CMake
  393. project.
  394. ``configurePreset``
  395. An optional string specifying the name of a configure preset to
  396. associate with this build preset. If ``configurePreset`` is not
  397. specified, it must be inherited from the inherits preset (unless this
  398. preset is hidden). The build directory is inferred from the configure
  399. preset, so the build will take place in the same ``binaryDir`` that the
  400. configuration did.
  401. ``inheritConfigureEnvironment``
  402. An optional boolean that defaults to true. If true, the environment
  403. variables from the associated configure preset are inherited after all
  404. inherited build preset environments, but before environment variables
  405. explicitly specified in this build preset.
  406. ``jobs``
  407. An optional integer. Equivalent to passing
  408. :option:`--parallel <cmake--build --parallel>` or ``-j`` on the command line.
  409. ``targets``
  410. An optional string or array of strings. Equivalent to passing
  411. :option:`--target <cmake--build --target>` or ``-t`` on the command line.
  412. Vendors may ignore the targets property or hide build presets that
  413. explicitly specify targets. This field supports macro expansion.
  414. ``configuration``
  415. An optional string. Equivalent to passing
  416. :option:`--config <cmake--build --config>` on the command line.
  417. ``cleanFirst``
  418. An optional bool. If true, equivalent to passing
  419. :option:`--clean-first <cmake--build --clean-first>` on the command line.
  420. ``resolvePackageReferences``
  421. An optional string that specifies the package resolve mode. This is
  422. allowed in preset files specifying version ``4`` or above.
  423. Package references are used to define dependencies to packages from
  424. external package managers. Currently only NuGet in combination with the
  425. Visual Studio generator is supported. If there are no targets that define
  426. package references, this option does nothing. Valid values are:
  427. ``on``
  428. Causes package references to be resolved before attempting a build.
  429. ``off``
  430. Package references will not be resolved. Note that this may cause
  431. errors in some build environments, such as .NET SDK style projects.
  432. ``only``
  433. Only resolve package references, but do not perform a build.
  434. .. note::
  435. The command line parameter
  436. :option:`--resolve-package-references <cmake--build --resolve-package-references>`
  437. will take priority over this setting. If the command line parameter is not
  438. provided and this setting is not specified, an environment-specific cache
  439. variable will be evaluated to decide, if package restoration should be
  440. performed.
  441. When using the Visual Studio generator, package references are defined
  442. using the :prop_tgt:`VS_PACKAGE_REFERENCES` property. Package references
  443. are restored using NuGet. It can be disabled by setting the
  444. ``CMAKE_VS_NUGET_PACKAGE_RESTORE`` variable to ``OFF``. This can also be
  445. done from within a configure preset.
  446. ``verbose``
  447. An optional bool. If true, equivalent to passing
  448. :option:`--verbose <cmake--build --verbose>` on the command line.
  449. ``nativeToolOptions``
  450. An optional array of strings. Equivalent to passing options after ``--``
  451. on the command line. The array values support macro expansion.
  452. Test Preset
  453. ^^^^^^^^^^^
  454. Each entry of the ``testPresets`` array is a JSON object
  455. that may contain the following fields:
  456. ``name``
  457. A required string representing the machine-friendly name of the preset.
  458. This identifier is used in the :option:`ctest --preset` option.
  459. There must not be two test presets in the union of ``CMakePresets.json``
  460. and ``CMakeUserPresets.json`` in the same directory with the same name.
  461. However, a test preset may have the same name as a configure, build,
  462. package, or workflow preset.
  463. ``hidden``
  464. An optional boolean specifying whether or not a preset should be hidden.
  465. If a preset is hidden, it cannot be used in the
  466. :option:`--preset <ctest --preset>` argument
  467. and does not have to have a valid ``configurePreset``, even from
  468. inheritance. ``hidden`` presets are intended to be used as a base for
  469. other presets to inherit via the ``inherits`` field.
  470. ``inherits``
  471. An optional array of strings representing the names of presets to inherit
  472. from. This field can also be a string, which is equivalent to an array
  473. containing one string.
  474. The preset will inherit all of the fields from the
  475. ``inherits`` presets by default (except ``name``, ``hidden``,
  476. ``inherits``, ``description``, and ``displayName``), but can override
  477. them as desired. If multiple ``inherits`` presets provide conflicting
  478. values for the same field, the earlier preset in the ``inherits`` array
  479. will be preferred.
  480. A preset can only inherit from another preset that is defined in the
  481. same file or in one of the files it includes (directly or indirectly).
  482. Presets in ``CMakePresets.json`` may not inherit from presets in
  483. ``CMakeUserPresets.json``.
  484. ``condition``
  485. An optional `Condition`_ object. This is allowed in preset files specifying
  486. version ``3`` or above.
  487. ``vendor``
  488. An optional map containing vendor-specific information. CMake does not
  489. interpret the contents of this field except to verify that it is a map
  490. if it does exist. However, it should follow the same conventions as the
  491. root-level ``vendor`` field. If vendors use their own per-preset
  492. ``vendor`` field, they should implement inheritance in a sensible manner
  493. when appropriate.
  494. ``displayName``
  495. An optional string with a human-friendly name of the preset.
  496. ``description``
  497. An optional string with a human-friendly description of the preset.
  498. ``environment``
  499. An optional map of environment variables. The key is the variable name
  500. (which may not be an empty string), and the value is either ``null`` or
  501. a string representing the value of the variable. Each variable is set
  502. regardless of whether or not a value was given to it by the process's
  503. environment. This field supports macro expansion, and environment
  504. variables in this map may reference each other, and may be listed in any
  505. order, as long as such references do not cause a cycle (for example, if
  506. ``ENV_1`` is ``$env{ENV_2}``, ``ENV_2`` may not be ``$env{ENV_1}``.)
  507. Environment variables are inherited through the ``inherits`` field, and
  508. the preset's environment will be the union of its own ``environment``
  509. and the ``environment`` from all its parents. If multiple presets in
  510. this union define the same variable, the standard rules of ``inherits``
  511. are applied. Setting a variable to ``null`` causes it to not be set,
  512. even if a value was inherited from another preset.
  513. ``configurePreset``
  514. An optional string specifying the name of a configure preset to
  515. associate with this test preset. If ``configurePreset`` is not
  516. specified, it must be inherited from the inherits preset (unless this
  517. preset is hidden). The build directory is inferred from the configure
  518. preset, so tests will run in the same ``binaryDir`` that the
  519. configuration did and build did.
  520. ``inheritConfigureEnvironment``
  521. An optional boolean that defaults to true. If true, the environment
  522. variables from the associated configure preset are inherited after all
  523. inherited test preset environments, but before environment variables
  524. explicitly specified in this test preset.
  525. ``configuration``
  526. An optional string. Equivalent to passing
  527. :option:`--build-config <ctest --build-config>` on the command line.
  528. ``overwriteConfigurationFile``
  529. An optional array of configuration options to overwrite options
  530. specified in the CTest configuration file. Equivalent to passing
  531. :option:`--overwrite <ctest --overwrite>` for each value in the array.
  532. The array values support macro expansion.
  533. ``output``
  534. An optional object specifying output options. The object may contain the
  535. following fields.
  536. ``shortProgress``
  537. An optional bool. If true, equivalent to passing
  538. :option:`--progress <ctest --progress>` on the command line.
  539. ``verbosity``
  540. An optional string specifying verbosity level. Must be one of the
  541. following:
  542. ``default``
  543. Equivalent to passing no verbosity flags on the command line.
  544. ``verbose``
  545. Equivalent to passing :option:`--verbose <ctest --verbose>` on
  546. the command line.
  547. ``extra``
  548. Equivalent to passing :option:`--extra-verbose <ctest --extra-verbose>`
  549. on the command line.
  550. ``debug``
  551. An optional bool. If true, equivalent to passing
  552. :option:`--debug <ctest --debug>` on the command line.
  553. ``outputOnFailure``
  554. An optional bool. If true, equivalent to passing
  555. :option:`--output-on-failure <ctest --output-on-failure>` on the command
  556. line.
  557. ``quiet``
  558. An optional bool. If true, equivalent to passing
  559. :option:`--quiet <ctest --quiet>` on the command line.
  560. ``outputLogFile``
  561. An optional string specifying a path to a log file. Equivalent to
  562. passing :option:`--output-log <ctest --output-log>` on the command line.
  563. This field supports macro expansion.
  564. ``outputJUnitFile``
  565. An optional string specifying a path to a JUnit file. Equivalent to
  566. passing :option:`--output-junit <ctest --output-junit>` on the command line.
  567. This field supports macro expansion. This is allowed in preset files
  568. specifying version ``6`` or above.
  569. ``labelSummary``
  570. An optional bool. If false, equivalent to passing
  571. :option:`--no-label-summary <ctest --no-label-summary>` on the command
  572. line.
  573. ``subprojectSummary``
  574. An optional bool. If false, equivalent to passing
  575. :option:`--no-subproject-summary <ctest --no-subproject-summary>`
  576. on the command line.
  577. ``maxPassedTestOutputSize``
  578. An optional integer specifying the maximum output for passed tests in
  579. bytes. Equivalent to passing
  580. :option:`--test-output-size-passed <ctest --test-output-size-passed>`
  581. on the command line.
  582. ``maxFailedTestOutputSize``
  583. An optional integer specifying the maximum output for failed tests in
  584. bytes. Equivalent to passing
  585. :option:`--test-output-size-failed <ctest --test-output-size-failed>`
  586. on the command line.
  587. ``testOutputTruncation``
  588. An optional string specifying the test output truncation mode. Equivalent
  589. to passing
  590. :option:`--test-output-truncation <ctest --test-output-truncation>` on
  591. the command line. This is allowed in preset files specifying version
  592. ``5`` or above.
  593. ``maxTestNameWidth``
  594. An optional integer specifying the maximum width of a test name to
  595. output. Equivalent to passing :option:`--max-width <ctest --max-width>`
  596. on the command line.
  597. ``filter``
  598. An optional object specifying how to filter the tests to run. The object
  599. may contain the following fields.
  600. ``include``
  601. An optional object specifying which tests to include. The object may
  602. contain the following fields.
  603. ``name``
  604. An optional string specifying a regex for test names. Equivalent to
  605. passing :option:`--tests-regex <ctest --tests-regex>` on the command
  606. line. This field supports macro expansion. CMake regex syntax is
  607. described under :ref:`string(REGEX) <Regex Specification>`.
  608. ``label``
  609. An optional string specifying a regex for test labels. Equivalent to
  610. passing :option:`--label-regex <ctest --label-regex>` on the command
  611. line. This field supports macro expansion.
  612. ``useUnion``
  613. An optional bool. Equivalent to passing :option:`--union <ctest --union>`
  614. on the command line.
  615. ``index``
  616. An optional object specifying tests to include by test index. The
  617. object may contain the following fields. Can also be an optional
  618. string specifying a file with the command line syntax for
  619. :option:`--tests-information <ctest --tests-information>`.
  620. If specified as a string, this field supports macro expansion.
  621. ``start``
  622. An optional integer specifying a test index to start testing at.
  623. ``end``
  624. An optional integer specifying a test index to stop testing at.
  625. ``stride``
  626. An optional integer specifying the increment.
  627. ``specificTests``
  628. An optional array of integers specifying specific test indices to
  629. run.
  630. ``exclude``
  631. An optional object specifying which tests to exclude. The object may
  632. contain the following fields.
  633. ``name``
  634. An optional string specifying a regex for test names. Equivalent to
  635. passing :option:`--exclude-regex <ctest --exclude-regex>` on the
  636. command line. This field supports macro expansion.
  637. ``label``
  638. An optional string specifying a regex for test labels. Equivalent to
  639. passing :option:`--label-exclude <ctest --label-exclude>` on the
  640. command line. This field supports macro expansion.
  641. ``fixtures``
  642. An optional object specifying which fixtures to exclude from adding
  643. tests. The object may contain the following fields.
  644. ``any``
  645. An optional string specifying a regex for text fixtures to exclude
  646. from adding any tests. Equivalent to
  647. :option:`--fixture-exclude-any <ctest --fixture-exclude-any>` on
  648. the command line. This field supports macro expansion.
  649. ``setup``
  650. An optional string specifying a regex for text fixtures to exclude
  651. from adding setup tests. Equivalent to
  652. :option:`--fixture-exclude-setup <ctest --fixture-exclude-setup>`
  653. on the command line. This field supports macro expansion.
  654. ``cleanup``
  655. An optional string specifying a regex for text fixtures to exclude
  656. from adding cleanup tests. Equivalent to
  657. :option:`--fixture-exclude-cleanup <ctest --fixture-exclude-cleanup>`
  658. on the command line. This field supports macro expansion.
  659. ``execution``
  660. An optional object specifying options for test execution. The object may
  661. contain the following fields.
  662. ``stopOnFailure``
  663. An optional bool. If true, equivalent to passing
  664. :option:`--stop-on-failure <ctest --stop-on-failure>` on the command
  665. line.
  666. ``enableFailover``
  667. An optional bool. If true, equivalent to passing :option:`-F <ctest -F>`
  668. on the command line.
  669. ``jobs``
  670. An optional integer. Equivalent to passing
  671. :option:`--parallel <ctest --parallel>` on the command line.
  672. ``resourceSpecFile``
  673. An optional string. Equivalent to passing
  674. :option:`--resource-spec-file <ctest --resource-spec-file>` on
  675. the command line. This field supports macro expansion.
  676. ``testLoad``
  677. An optional integer. Equivalent to passing
  678. :option:`--test-load <ctest --test-load>` on the command line.
  679. ``showOnly``
  680. An optional string. Equivalent to passing
  681. :option:`--show-only <ctest --show-only>` on the
  682. command line. The string must be one of the following values:
  683. ``human``
  684. ``json-v1``
  685. ``repeat``
  686. An optional object specifying how to repeat tests. Equivalent to
  687. passing :option:`--repeat <ctest --repeat>` on the command line.
  688. The object must have the following fields.
  689. ``mode``
  690. A required string. Must be one of the following values:
  691. ``until-fail``
  692. ``until-pass``
  693. ``after-timeout``
  694. ``count``
  695. A required integer.
  696. ``interactiveDebugging``
  697. An optional bool. If true, equivalent to passing
  698. :option:`--interactive-debug-mode 1 <ctest --interactive-debug-mode>`
  699. on the command line. If false, equivalent to passing
  700. :option:`--interactive-debug-mode 0 <ctest --interactive-debug-mode>`
  701. on the command line.
  702. ``scheduleRandom``
  703. An optional bool. If true, equivalent to passing
  704. :option:`--schedule-random <ctest --schedule-random>` on the command
  705. line.
  706. ``timeout``
  707. An optional integer. Equivalent to passing
  708. :option:`--timeout <ctest --timeout>` on the command line.
  709. ``noTestsAction``
  710. An optional string specifying the behavior if no tests are found. Must
  711. be one of the following values:
  712. ``default``
  713. Equivalent to not passing any value on the command line.
  714. ``error``
  715. Equivalent to passing :option:`--no-tests=error <ctest --no-tests>`
  716. on the command line.
  717. ``ignore``
  718. Equivalent to passing :option:`--no-tests=ignore <ctest --no-tests>`
  719. on the command line.
  720. Package Preset
  721. ^^^^^^^^^^^^^^
  722. Package presets may be used in schema version ``6`` or above. Each entry of
  723. the ``packagePresets`` array is a JSON object that may contain the following
  724. fields:
  725. ``name``
  726. A required string representing the machine-friendly name of the preset.
  727. This identifier is used in the :option:`cpack --preset` option.
  728. There must not be two package presets in the union of ``CMakePresets.json``
  729. and ``CMakeUserPresets.json`` in the same directory with the same name.
  730. However, a package preset may have the same name as a configure, build,
  731. test, or workflow preset.
  732. ``hidden``
  733. An optional boolean specifying whether or not a preset should be hidden.
  734. If a preset is hidden, it cannot be used in the
  735. :option:`--preset <cpack --preset>` argument
  736. and does not have to have a valid ``configurePreset``, even from
  737. inheritance. ``hidden`` presets are intended to be used as a base for
  738. other presets to inherit via the ``inherits`` field.
  739. ``inherits``
  740. An optional array of strings representing the names of presets to inherit
  741. from. This field can also be a string, which is equivalent to an array
  742. containing one string.
  743. The preset will inherit all of the fields from the
  744. ``inherits`` presets by default (except ``name``, ``hidden``,
  745. ``inherits``, ``description``, and ``displayName``), but can override
  746. them as desired. If multiple ``inherits`` presets provide conflicting
  747. values for the same field, the earlier preset in the ``inherits`` array
  748. will be preferred.
  749. A preset can only inherit from another preset that is defined in the
  750. same file or in one of the files it includes (directly or indirectly).
  751. Presets in ``CMakePresets.json`` may not inherit from presets in
  752. ``CMakeUserPresets.json``.
  753. ``condition``
  754. An optional `Condition`_ object.
  755. ``vendor``
  756. An optional map containing vendor-specific information. CMake does not
  757. interpret the contents of this field except to verify that it is a map
  758. if it does exist. However, it should follow the same conventions as the
  759. root-level ``vendor`` field. If vendors use their own per-preset
  760. ``vendor`` field, they should implement inheritance in a sensible manner
  761. when appropriate.
  762. ``displayName``
  763. An optional string with a human-friendly name of the preset.
  764. ``description``
  765. An optional string with a human-friendly description of the preset.
  766. ``environment``
  767. An optional map of environment variables. The key is the variable name
  768. (which may not be an empty string), and the value is either ``null`` or
  769. a string representing the value of the variable. Each variable is set
  770. regardless of whether or not a value was given to it by the process's
  771. environment. This field supports macro expansion, and environment
  772. variables in this map may reference each other, and may be listed in any
  773. order, as long as such references do not cause a cycle (for example, if
  774. ``ENV_1`` is ``$env{ENV_2}``, ``ENV_2`` may not be ``$env{ENV_1}``.)
  775. Environment variables are inherited through the ``inherits`` field, and
  776. the preset's environment will be the union of its own ``environment``
  777. and the ``environment`` from all its parents. If multiple presets in
  778. this union define the same variable, the standard rules of ``inherits``
  779. are applied. Setting a variable to ``null`` causes it to not be set,
  780. even if a value was inherited from another preset.
  781. ``configurePreset``
  782. An optional string specifying the name of a configure preset to
  783. associate with this package preset. If ``configurePreset`` is not
  784. specified, it must be inherited from the inherits preset (unless this
  785. preset is hidden). The build directory is inferred from the configure
  786. preset, so packaging will run in the same ``binaryDir`` that the
  787. configuration did and build did.
  788. ``inheritConfigureEnvironment``
  789. An optional boolean that defaults to true. If true, the environment
  790. variables from the associated configure preset are inherited after all
  791. inherited package preset environments, but before environment variables
  792. explicitly specified in this package preset.
  793. ``generators``
  794. An optional array of strings representing generators for CPack to use.
  795. ``configurations``
  796. An optional array of strings representing build configurations for CPack to
  797. package.
  798. ``variables``
  799. An optional map of variables to pass to CPack, equivalent to
  800. :option:`-D <cpack -D>` arguments. Each key is the name of a variable, and
  801. the value is the string to assign to that variable.
  802. ``configFile``
  803. An optional string representing the config file for CPack to use.
  804. ``output``
  805. An optional object specifying output options. Valid keys are:
  806. ``debug``
  807. An optional boolean specifying whether or not to print debug information.
  808. A value of ``true`` is equivalent to passing
  809. :option:`--debug <cpack --debug>` on the command line.
  810. ``verbose``
  811. An optional boolean specifying whether or not to print verbosely. A value
  812. of ``true`` is equivalent to passing :option:`--verbose <cpack --verbose>`
  813. on the command line.
  814. ``packageName``
  815. An optional string representing the package name.
  816. ``packageVersion``
  817. An optional string representing the package version.
  818. ``packageDirectory``
  819. An optional string representing the directory in which to place the package.
  820. ``vendorName``
  821. An optional string representing the vendor name.
  822. .. _`Workflow Preset`:
  823. Workflow Preset
  824. ^^^^^^^^^^^^^^^
  825. Workflow presets may be used in schema version ``6`` or above. Each entry of
  826. the ``workflowPresets`` array is a JSON object that may contain the following
  827. fields:
  828. ``name``
  829. A required string representing the machine-friendly name of the preset.
  830. This identifier is used in the
  831. :ref:`cmake --workflow --preset <Workflow Mode>` option. There must not be
  832. two workflow presets in the union of ``CMakePresets.json`` and
  833. ``CMakeUserPresets.json`` in the same directory with the same name. However,
  834. a workflow preset may have the same name as a configure, build, test, or
  835. package preset.
  836. ``displayName``
  837. An optional string with a human-friendly name of the preset.
  838. ``description``
  839. An optional string with a human-friendly description of the preset.
  840. ``steps``
  841. A required array of objects describing the steps of the workflow. The first
  842. step must be a configure preset, and all subsequent steps must be non-
  843. configure presets whose ``configurePreset`` field matches the starting
  844. configure preset. Each object may contain the following fields:
  845. ``type``
  846. A required string. The first step must be ``configure``. Subsequent steps
  847. must be either ``build``, ``test``, or ``package``.
  848. ``name``
  849. A required string representing the name of the configure, build, test, or
  850. package preset to run as this workflow step.
  851. Condition
  852. ^^^^^^^^^
  853. The ``condition`` field of a preset, allowed in preset files specifying version
  854. ``3`` or above, is used to determine whether or not the preset is enabled. For
  855. example, this can be used to disable a preset on platforms other than Windows.
  856. ``condition`` may be either a boolean, ``null``, or an object. If it is a
  857. boolean, the boolean indicates whether the preset is enabled or disabled. If it
  858. is ``null``, the preset is enabled, but the ``null`` condition is not inherited
  859. by any presets that may inherit from the preset. Sub-conditions (for example in
  860. a ``not``, ``anyOf``, or ``allOf`` condition) may not be ``null``. If it is an
  861. object, it has the following fields:
  862. ``type``
  863. A required string with one of the following values:
  864. ``"const"``
  865. Indicates that the condition is constant. This is equivalent to using a
  866. boolean in place of the object. The condition object will have the
  867. following additional fields:
  868. ``value``
  869. A required boolean which provides a constant value for the condition's
  870. evaluation.
  871. ``"equals"``
  872. ``"notEquals"``
  873. Indicates that the condition compares two strings to see if they are equal
  874. (or not equal). The condition object will have the following additional
  875. fields:
  876. ``lhs``
  877. First string to compare. This field supports macro expansion.
  878. ``rhs``
  879. Second string to compare. This field supports macro expansion.
  880. ``"inList"``
  881. ``"notInList"``
  882. Indicates that the condition searches for a string in a list of strings.
  883. The condition object will have the following additional fields:
  884. ``string``
  885. A required string to search for. This field supports macro expansion.
  886. ``list``
  887. A required array of strings to search. This field supports macro
  888. expansion, and uses short-circuit evaluation.
  889. ``"matches"``
  890. ``"notMatches"``
  891. Indicates that the condition searches for a regular expression in a string.
  892. The condition object will have the following additional fields:
  893. ``string``
  894. A required string to search. This field supports macro expansion.
  895. ``regex``
  896. A required regular expression to search for. This field supports macro
  897. expansion.
  898. ``"anyOf"``
  899. ``"allOf"``
  900. Indicates that the condition is an aggregation of zero or more nested
  901. conditions. The condition object will have the following additional fields:
  902. ``conditions``
  903. A required array of condition objects. These conditions use short-circuit
  904. evaluation.
  905. ``"not"``
  906. Indicates that the condition is an inversion of another condition. The
  907. condition object will have the following additional fields:
  908. ``condition``
  909. A required condition object.
  910. Macro Expansion
  911. ^^^^^^^^^^^^^^^
  912. As mentioned above, some fields support macro expansion. Macros are
  913. recognized in the form ``$<macro-namespace>{<macro-name>}``. All macros are
  914. evaluated in the context of the preset being used, even if the macro is in a
  915. field that was inherited from another preset. For example, if the ``Base``
  916. preset sets variable ``PRESET_NAME`` to ``${presetName}``, and the
  917. ``Derived`` preset inherits from ``Base``, ``PRESET_NAME`` will be set to
  918. ``Derived``.
  919. It is an error to not put a closing brace at the end of a macro name. For
  920. example, ``${sourceDir`` is invalid. A dollar sign (``$``) followed by
  921. anything other than a left curly brace (``{``) with a possible namespace is
  922. interpreted as a literal dollar sign.
  923. Recognized macros include:
  924. ``${sourceDir}``
  925. Path to the project source directory (i.e. the same as
  926. :variable:`CMAKE_SOURCE_DIR`).
  927. ``${sourceParentDir}``
  928. Path to the project source directory's parent directory.
  929. ``${sourceDirName}``
  930. The last filename component of ``${sourceDir}``. For example, if
  931. ``${sourceDir}`` is ``/path/to/source``, this would be ``source``.
  932. ``${presetName}``
  933. Name specified in the preset's ``name`` field.
  934. ``${generator}``
  935. Generator specified in the preset's ``generator`` field. For build and
  936. test presets, this will evaluate to the generator specified by
  937. ``configurePreset``.
  938. ``${hostSystemName}``
  939. The name of the host operating system. Contains the same value as
  940. :variable:`CMAKE_HOST_SYSTEM_NAME`. This is allowed in preset files
  941. specifying version ``3`` or above.
  942. ``${fileDir}``
  943. Path to the directory containing the preset file which contains the macro.
  944. This is allowed in preset files specifying version ``4`` or above.
  945. ``${dollar}``
  946. A literal dollar sign (``$``).
  947. ``${pathListSep}``
  948. Native character for separating lists of paths, such as ``:`` or ``;``.
  949. For example, by setting ``PATH`` to
  950. ``/path/to/ninja/bin${pathListSep}$env{PATH}``, ``${pathListSep}`` will
  951. expand to the underlying operating system's character used for
  952. concatenation in ``PATH``.
  953. This is allowed in preset files specifying version ``5`` or above.
  954. ``$env{<variable-name>}``
  955. Environment variable with name ``<variable-name>``. The variable name may
  956. not be an empty string. If the variable is defined in the ``environment``
  957. field, that value is used instead of the value from the parent environment.
  958. If the environment variable is not defined, this evaluates as an empty
  959. string.
  960. Note that while Windows environment variable names are case-insensitive,
  961. variable names within a preset are still case-sensitive. This may lead to
  962. unexpected results when using inconsistent casing. For best results, keep
  963. the casing of environment variable names consistent.
  964. ``$penv{<variable-name>}``
  965. Similar to ``$env{<variable-name>}``, except that the value only comes from
  966. the parent environment, and never from the ``environment`` field. This
  967. allows you to prepend or append values to existing environment variables.
  968. For example, setting ``PATH`` to ``/path/to/ninja/bin:$penv{PATH}`` will
  969. prepend ``/path/to/ninja/bin`` to the ``PATH`` environment variable. This
  970. is needed because ``$env{<variable-name>}`` does not allow circular
  971. references.
  972. ``$vendor{<macro-name>}``
  973. An extension point for vendors to insert their own macros. CMake will not
  974. be able to use presets which have a ``$vendor{<macro-name>}`` macro, and
  975. effectively ignores such presets. However, it will still be able to use
  976. other presets from the same file.
  977. CMake does not make any attempt to interpret ``$vendor{<macro-name>}``
  978. macros. However, to avoid name collisions, IDE vendors should prefix
  979. ``<macro-name>`` with a very short (preferably <= 4 characters) vendor
  980. identifier prefix, followed by a ``.``, followed by the macro name. For
  981. example, the Example IDE could have ``$vendor{xide.ideInstallDir}``.
  982. Schema
  983. ======
  984. :download:`This file </manual/presets/schema.json>` provides a machine-readable
  985. JSON schema for the ``CMakePresets.json`` format.