|
|
@@ -19,27 +19,15 @@ supports files included with the ``include`` field.
|
|
|
|
|
|
|
|
|
|
|
|
``CMakePresets.json`` and ``CMakeUserPresets.json`` live in the project's root
|
|
|
|
``CMakePresets.json`` and ``CMakeUserPresets.json`` live in the project's root
|
|
|
|
directory. They both have exactly the same format, and both are optional
|
|
|
|
directory. They both have exactly the same format, and both are optional
|
|
|
|
(though at least one must be present if ``--preset`` is specified.)
|
|
|
|
(though at least one must be present if ``--preset`` is specified).
|
|
|
|
``CMakePresets.json`` is meant to save project-wide builds, while
|
|
|
|
``CMakePresets.json`` is meant to specify project-wide build details, while
|
|
|
|
``CMakeUserPresets.json`` is meant for developers to save their own local
|
|
|
|
``CMakeUserPresets.json`` is meant for developers to specify their own local
|
|
|
|
builds. ``CMakePresets.json`` may be checked into a version control system, and
|
|
|
|
build details.
|
|
|
|
``CMakeUserPresets.json`` should NOT be checked in. For example, if a project
|
|
|
|
|
|
|
|
is using Git, ``CMakePresets.json`` may be tracked, and
|
|
|
|
|
|
|
|
``CMakeUserPresets.json`` should be added to the ``.gitignore``.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
``CMakePresets.json`` and ``CMakeUserPresets.json`` can include other files
|
|
|
|
``CMakePresets.json`` may be checked into a version control system, and
|
|
|
|
with the ``include`` field in file version ``4`` and later. Files included by
|
|
|
|
``CMakeUserPresets.json`` should NOT be checked in. For example, if a
|
|
|
|
these files can also include other files. If a preset file contains presets
|
|
|
|
project is using Git, ``CMakePresets.json`` may be tracked, and
|
|
|
|
that inherit from presets in another file, the file must include the other file
|
|
|
|
``CMakeUserPresets.json`` should be added to the ``.gitignore``.
|
|
|
|
either directly or indirectly. Include cycles are not allowed among files (if
|
|
|
|
|
|
|
|
``a.json`` includes ``b.json``, ``b.json`` cannot include ``a.json``). However,
|
|
|
|
|
|
|
|
a file may be included multiple times from the same file or from different
|
|
|
|
|
|
|
|
files. If ``CMakePresets.json`` and ``CMakeUserPresets.json`` are both present,
|
|
|
|
|
|
|
|
``CMakeUserPresets.json`` implicitly includes ``CMakePresets.json``, even with
|
|
|
|
|
|
|
|
no ``include`` field, in all versions of the format. Files directly or
|
|
|
|
|
|
|
|
indirectly included from ``CMakePresets.json`` should be guaranteed to be
|
|
|
|
|
|
|
|
provided by the project. ``CMakeUserPresets.json`` may include files from
|
|
|
|
|
|
|
|
anywhere.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Format
|
|
|
|
Format
|
|
|
|
======
|
|
|
|
======
|
|
|
@@ -73,6 +61,13 @@ The root object recognizes the following fields:
|
|
|
|
|
|
|
|
|
|
|
|
An optional integer representing the patch version.
|
|
|
|
An optional integer representing the patch version.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
``include``
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
An optional array of strings representing files to include. If the filenames
|
|
|
|
|
|
|
|
are not absolute, they are considered relative to the current file.
|
|
|
|
|
|
|
|
This is allowed in preset files specifying version ``4`` or above.
|
|
|
|
|
|
|
|
See `Includes`_ for discussion of the constraints on included files.
|
|
|
|
|
|
|
|
|
|
|
|
``vendor``
|
|
|
|
``vendor``
|
|
|
|
|
|
|
|
|
|
|
|
An optional map containing vendor-specific information. CMake does not
|
|
|
|
An optional map containing vendor-specific information. CMake does not
|
|
|
@@ -97,11 +92,25 @@ The root object recognizes the following fields:
|
|
|
|
An optional array of `Test Preset`_ objects.
|
|
|
|
An optional array of `Test Preset`_ objects.
|
|
|
|
This is allowed in preset files specifying version ``2`` or above.
|
|
|
|
This is allowed in preset files specifying version ``2`` or above.
|
|
|
|
|
|
|
|
|
|
|
|
``include``
|
|
|
|
Includes
|
|
|
|
|
|
|
|
^^^^^^^^
|
|
|
|
|
|
|
|
|
|
|
|
An optional array of strings representing files to include. If the filenames
|
|
|
|
``CMakePresets.json`` and ``CMakeUserPresets.json`` can include other files
|
|
|
|
are not absolute, they are considered relative to the current file.
|
|
|
|
with the ``include`` field in file version ``4`` and later. Files included
|
|
|
|
This is allowed in preset files specifying version ``4`` or above.
|
|
|
|
by these files can also include other files. If ``CMakePresets.json`` and
|
|
|
|
|
|
|
|
``CMakeUserPresets.json`` are both present, ``CMakeUserPresets.json``
|
|
|
|
|
|
|
|
implicitly includes ``CMakePresets.json``, even with no ``include`` field,
|
|
|
|
|
|
|
|
in all versions of the format.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If a preset file contains presets that inherit from presets in another file,
|
|
|
|
|
|
|
|
the file must include the other file either directly or indirectly.
|
|
|
|
|
|
|
|
Include cycles are not allowed among files. If ``a.json`` includes
|
|
|
|
|
|
|
|
``b.json``, ``b.json`` cannot include ``a.json``. However, a file may be
|
|
|
|
|
|
|
|
included multiple times from the same file or from different files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Files directly or indirectly included from ``CMakePresets.json`` should be
|
|
|
|
|
|
|
|
guaranteed to be provided by the project. ``CMakeUserPresets.json`` may
|
|
|
|
|
|
|
|
include files from anywhere.
|
|
|
|
|
|
|
|
|
|
|
|
Configure Preset
|
|
|
|
Configure Preset
|
|
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
^^^^^^^^^^^^^^^^
|
|
|
@@ -129,16 +138,20 @@ that may contain the following fields:
|
|
|
|
``inherits``
|
|
|
|
``inherits``
|
|
|
|
|
|
|
|
|
|
|
|
An optional array of strings representing the names of presets to inherit
|
|
|
|
An optional array of strings representing the names of presets to inherit
|
|
|
|
from. The preset will inherit all of the fields from the ``inherits``
|
|
|
|
from. This field can also be a string, which is equivalent to an array
|
|
|
|
|
|
|
|
containing one string.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The preset will inherit all of the fields from the ``inherits``
|
|
|
|
presets by default (except ``name``, ``hidden``, ``inherits``,
|
|
|
|
presets by default (except ``name``, ``hidden``, ``inherits``,
|
|
|
|
``description``, and ``displayName``), but can override them as
|
|
|
|
``description``, and ``displayName``), but can override them as
|
|
|
|
desired. If multiple ``inherits`` presets provide conflicting values for
|
|
|
|
desired. If multiple ``inherits`` presets provide conflicting values for
|
|
|
|
the same field, the earlier preset in the ``inherits`` list will be
|
|
|
|
the same field, the earlier preset in the ``inherits`` list will be
|
|
|
|
preferred. Presets in ``CMakePresets.json`` may not inherit from presets
|
|
|
|
preferred.
|
|
|
|
in ``CMakeUserPresets.json``.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This field can also be a string, which is equivalent to an array
|
|
|
|
A preset can only inherit from another preset that is defined in the
|
|
|
|
containing one string.
|
|
|
|
same file or in one of the files it includes (directly or indirectly).
|
|
|
|
|
|
|
|
Presets in ``CMakePresets.json`` may not inherit from presets in
|
|
|
|
|
|
|
|
``CMakeUserPresets.json``.
|
|
|
|
|
|
|
|
|
|
|
|
``condition``
|
|
|
|
``condition``
|
|
|
|
|
|
|
|
|
|
|
@@ -371,17 +384,21 @@ that may contain the following fields:
|
|
|
|
|
|
|
|
|
|
|
|
``inherits``
|
|
|
|
``inherits``
|
|
|
|
|
|
|
|
|
|
|
|
An optional array of strings representing the names of presets to
|
|
|
|
An optional array of strings representing the names of presets to inherit
|
|
|
|
inherit from. The preset will inherit all of the fields from the
|
|
|
|
from. This field can also be a string, which is equivalent to an array
|
|
|
|
|
|
|
|
containing one string.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The preset will inherit all of the fields from the
|
|
|
|
``inherits`` presets by default (except ``name``, ``hidden``,
|
|
|
|
``inherits`` presets by default (except ``name``, ``hidden``,
|
|
|
|
``inherits``, ``description``, and ``displayName``), but can override
|
|
|
|
``inherits``, ``description``, and ``displayName``), but can override
|
|
|
|
them as desired. If multiple ``inherits`` presets provide conflicting
|
|
|
|
them as desired. If multiple ``inherits`` presets provide conflicting
|
|
|
|
values for the same field, the earlier preset in the ``inherits`` list
|
|
|
|
values for the same field, the earlier preset in the ``inherits`` list
|
|
|
|
will be preferred. Presets in ``CMakePresets.json`` may not inherit from
|
|
|
|
will be preferred.
|
|
|
|
presets in ``CMakeUserPresets.json``.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This field can also be a string, which is equivalent to an array
|
|
|
|
A preset can only inherit from another preset that is defined in the
|
|
|
|
containing one string.
|
|
|
|
same file or in one of the files it includes (directly or indirectly).
|
|
|
|
|
|
|
|
Presets in ``CMakePresets.json`` may not inherit from presets in
|
|
|
|
|
|
|
|
``CMakeUserPresets.json``.
|
|
|
|
|
|
|
|
|
|
|
|
``condition``
|
|
|
|
``condition``
|
|
|
|
|
|
|
|
|
|
|
@@ -544,17 +561,21 @@ that may contain the following fields:
|
|
|
|
|
|
|
|
|
|
|
|
``inherits``
|
|
|
|
``inherits``
|
|
|
|
|
|
|
|
|
|
|
|
An optional array of strings representing the names of presets to
|
|
|
|
An optional array of strings representing the names of presets to inherit
|
|
|
|
inherit from. The preset will inherit all of the fields from the
|
|
|
|
from. This field can also be a string, which is equivalent to an array
|
|
|
|
|
|
|
|
containing one string.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The preset will inherit all of the fields from the
|
|
|
|
``inherits`` presets by default (except ``name``, ``hidden``,
|
|
|
|
``inherits`` presets by default (except ``name``, ``hidden``,
|
|
|
|
``inherits``, ``description``, and ``displayName``), but can override
|
|
|
|
``inherits``, ``description``, and ``displayName``), but can override
|
|
|
|
them as desired. If multiple ``inherits`` presets provide conflicting
|
|
|
|
them as desired. If multiple ``inherits`` presets provide conflicting
|
|
|
|
values for the same field, the earlier preset in the ``inherits`` list
|
|
|
|
values for the same field, the earlier preset in the ``inherits`` list
|
|
|
|
will be preferred. Presets in ``CMakePresets.json`` may not inherit from
|
|
|
|
will be preferred.
|
|
|
|
presets in ``CMakeUserPresets.json``.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This field can also be a string, which is equivalent to an array
|
|
|
|
A preset can only inherit from another preset that is defined in the
|
|
|
|
containing one string.
|
|
|
|
same file or in one of the files it includes (directly or indirectly).
|
|
|
|
|
|
|
|
Presets in ``CMakePresets.json`` may not inherit from presets in
|
|
|
|
|
|
|
|
``CMakeUserPresets.json``.
|
|
|
|
|
|
|
|
|
|
|
|
``condition``
|
|
|
|
``condition``
|
|
|
|
|
|
|
|
|
|
|
@@ -1004,7 +1025,8 @@ Recognized macros include:
|
|
|
|
|
|
|
|
|
|
|
|
``${sourceDir}``
|
|
|
|
``${sourceDir}``
|
|
|
|
|
|
|
|
|
|
|
|
Path to the project source directory.
|
|
|
|
Path to the project source directory (i.e. the same as
|
|
|
|
|
|
|
|
:variable:`CMAKE_SOURCE_DIR`).
|
|
|
|
|
|
|
|
|
|
|
|
``${sourceParentDir}``
|
|
|
|
``${sourceParentDir}``
|
|
|
|
|
|
|
|
|
|
|
|