cmake-presets.7.rst 49 KB

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