summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-09-28 14:38:25 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-09-28 14:38:41 (GMT)
commitb9968f3006cc1d072eb6a9afebc44a56016b2fcb (patch)
treeeacd65f9bc7326c80178b79be736f4d8492a53a6 /Help
parent17250fe2c9ad70610fce9079a50049e53d3b84b9 (diff)
parent374d82bbcd461a5ee8d1d9d3a94abd8a26759c37 (diff)
downloadCMake-b9968f3006cc1d072eb6a9afebc44a56016b2fcb.zip
CMake-b9968f3006cc1d072eb6a9afebc44a56016b2fcb.tar.gz
CMake-b9968f3006cc1d072eb6a9afebc44a56016b2fcb.tar.bz2
Merge topic 'cmake-presets-workflow'
374d82bbcd cmake: Add --workflow mode e316812884 CMakePresets.json: Add workflow presets to schema Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7711
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-presets.7.rst56
-rw-r--r--Help/manual/cmake.1.rst22
-rw-r--r--Help/manual/presets/example.json23
-rw-r--r--Help/manual/presets/schema.json85
-rw-r--r--Help/release/dev/cmake-presets-workflow.rst4
5 files changed, 179 insertions, 11 deletions
diff --git a/Help/manual/cmake-presets.7.rst b/Help/manual/cmake-presets.7.rst
index d5319f2..93f929e 100644
--- a/Help/manual/cmake-presets.7.rst
+++ b/Help/manual/cmake-presets.7.rst
@@ -106,6 +106,10 @@ The root object recognizes the following fields:
An optional array of `Package Preset`_ objects.
This is allowed in preset files specifying version ``6`` or above.
+``workflowPresets``
+ An optional array of `Workflow Preset`_ objects.
+ This is allowed in preset files specifying version ``6`` or above.
+
Includes
^^^^^^^^
@@ -137,8 +141,8 @@ that may contain the following fields:
This identifier is used in the :ref:`cmake --preset <CMake Options>` option.
There must not be two configure presets in the union of ``CMakePresets.json``
and ``CMakeUserPresets.json`` in the same directory with the same name.
- However, a configure preset may have the same name as a build, test, or
- package preset.
+ However, a configure preset may have the same name as a build, test,
+ package, or workflow preset.
``hidden``
An optional boolean specifying whether or not a preset should be hidden.
@@ -364,8 +368,8 @@ that may contain the following fields:
:ref:`cmake --build --preset <Build Tool Mode>` option.
There must not be two build presets in the union of ``CMakePresets.json``
and ``CMakeUserPresets.json`` in the same directory with the same name.
- However, a build preset may have the same name as a configure, test, or
- package preset.
+ However, a build preset may have the same name as a configure, test,
+ package, or workflow preset.
``hidden``
An optional boolean specifying whether or not a preset should be hidden.
@@ -525,8 +529,8 @@ that may contain the following fields:
This identifier is used in the :option:`ctest --preset` option.
There must not be two test presets in the union of ``CMakePresets.json``
and ``CMakeUserPresets.json`` in the same directory with the same name.
- However, a test preset may have the same name as a configure, build, or
- package preset.
+ However, a test preset may have the same name as a configure, build,
+ package, or workflow preset.
``hidden``
An optional boolean specifying whether or not a preset should be hidden.
@@ -861,8 +865,8 @@ fields:
This identifier is used in the :option:`cpack --preset` option.
There must not be two package presets in the union of ``CMakePresets.json``
and ``CMakeUserPresets.json`` in the same directory with the same name.
- However, a package preset may have the same name as a configure, build, or
- test preset.
+ However, a package preset may have the same name as a configure, build,
+ test, or workflow preset.
``hidden``
An optional boolean specifying whether or not a preset should be hidden.
@@ -977,6 +981,42 @@ fields:
``vendorName``
An optional string representing the vendor name.
+Workflow Preset
+^^^^^^^^^^^^^^^
+
+Workflow presets may be used in schema version ``6`` or above. Each entry of
+the ``workflowPresets`` array is a JSON object that may contain the following
+fields:
+
+``name``
+ A required string representing the machine-friendly name of the preset.
+ This identifier is used in the
+ :ref:`cmake --workflow --preset <Workflow Mode>` option. There must not be
+ two workflow presets in the union of ``CMakePresets.json`` and
+ ``CMakeUserPresets.json`` in the same directory with the same name. However,
+ a workflow preset may have the same name as a configure, build, test, or
+ package preset.
+
+``displayName``
+ An optional string with a human-friendly name of the preset.
+
+``description``
+ An optional string with a human-friendly description of the preset.
+
+``steps``
+ A required array of objects describing the steps of the workflow. The first
+ step must be a configure preset, and all subsequent steps must be non-
+ configure presets whose ``configurePreset`` field matches the starting
+ configure preset. Each object may contain the following fields:
+
+ ``type``
+ A required string. The first step must be ``configure``. Subsequent steps
+ must be either ``build``, ``test``, or ``package``.
+
+ ``name``
+ A required string representing the name of the configure, build, test, or
+ package preset to run as this workflow step.
+
Condition
^^^^^^^^^
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index 98655e5..c05f3c8 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -30,6 +30,9 @@ Synopsis
`Run the Find-Package Tool`_
cmake --find-package [<options>]
+ `Run a Workflow Preset`_
+ cmake --workflow [<options>]
+
`View Help`_
cmake --help[-<topic>]
@@ -1177,6 +1180,25 @@ autoconf-based projects (via ``share/aclocal/cmake.m4``).
This mode is not well-supported due to some technical limitations.
It is kept for compatibility but should not be used in new projects.
+.. _`Workflow Mode`:
+
+Run a Workflow Preset
+=====================
+
+:manual:`CMake Presets <cmake-presets(7)>` provides a way to execute multiple
+build steps in order:
+
+.. option:: --preset <preset>, --preset=<preset>
+
+ Use a workflow preset to specify a workflow. The project binary directory
+ is inferred from the initial configure preset. The current working directory
+ must contain CMake preset files.
+ See :manual:`preset <cmake-presets(7)>` for more details.
+
+.. option:: --list-presets
+
+ Lists the available workflow presets. The current working directory must
+ contain CMake preset files.
View Help
=========
diff --git a/Help/manual/presets/example.json b/Help/manual/presets/example.json
index 06a1112..696ab47 100644
--- a/Help/manual/presets/example.json
+++ b/Help/manual/presets/example.json
@@ -75,6 +75,29 @@
]
}
],
+ "workflowPresets": [
+ {
+ "name": "default",
+ "steps": [
+ {
+ "type": "configure",
+ "name": "default"
+ },
+ {
+ "type": "build",
+ "name": "default"
+ },
+ {
+ "type": "test",
+ "name": "default"
+ },
+ {
+ "type": "package",
+ "name": "default"
+ }
+ ]
+ }
+ ],
"vendor": {
"example.com/ExampleIDE/1.0": {
"autoFormat": false
diff --git a/Help/manual/presets/schema.json b/Help/manual/presets/schema.json
index f3a7532..b4db700 100644
--- a/Help/manual/presets/schema.json
+++ b/Help/manual/presets/schema.json
@@ -85,6 +85,7 @@
"buildPresets": { "$ref": "#/definitions/buildPresetsV4"},
"testPresets": { "$ref": "#/definitions/testPresetsV5"},
"packagePresets": { "$ref": "#/definitions/packagePresetsV6"},
+ "workflowPresets": { "$ref": "#/definitions/workflowPresetsV6" },
"include": { "$ref": "#/definitions/include"}
},
"additionalProperties": false
@@ -492,7 +493,7 @@
"properties": {
"name": {
"type": "string",
- "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, test, or package) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
+ "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, test, package, or workflow) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
"minLength": 1
},
"hidden": {
@@ -744,7 +745,7 @@
"properties": {
"name": {
"type": "string",
- "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, test, or package) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
+ "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, test, package, or workflow) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
"minLength": 1
},
"hidden": {
@@ -1153,7 +1154,7 @@
"properties": {
"name": {
"type": "string",
- "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, test, or package) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
+ "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, test, package, or workflow) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
"minLength": 1
},
"hidden": {
@@ -1321,6 +1322,84 @@
"additionalProperties": false
}
},
+ "workflowPresetsItemsV6": {
+ "type": "array",
+ "description": "An optional array of workflow preset objects. Used to execute configure, build, test, and package presets in order. Available in version 6 and higher.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "A required string representing the machine-friendly name of the preset. This identifier is used in the --preset argument. There must not be two presets (configure, build, test, package, or workflow) in the union of CMakePresets.json and CMakeUserPresets.json in the same directory with the same name.",
+ "minLength": 1
+ },
+ "vendor": {
+ "type": "object",
+ "description": "An optional map containing vendor-specific information. CMake does not interpret the contents of this field except to verify that it is a map if it does exist. However, it should follow the same conventions as the root-level vendor field.",
+ "properties": {}
+ },
+ "displayName": {
+ "type": "string",
+ "description": "An optional string with a human-friendly name of the preset."
+ },
+ "description": {
+ "type": "string",
+ "description": "An optional string with a human-friendly description of the preset."
+ },
+ "steps": {
+ "type": "array",
+ "description": "A required array of objects describing the steps of the workflow. The first step must be a configure preset, and all subsequent steps must be non-configure presets whose configurePreset field matches the starting configure preset.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "A required string. The first step must be configure. Subsequent steps must be either build, test, or package.",
+ "enum": ["configure", "build", "test", "package"]
+ },
+ "name": {
+ "type": "string",
+ "description": "A required string representing the name of the configure, build, test, or package preset to run as this workflow step.",
+ "minLength": 1
+ }
+ },
+ "required": [
+ "type",
+ "name"
+ ],
+ "additionalProperties": false
+ }
+ }
+ },
+ "required": [
+ "name",
+ "steps"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "workflowPresetsV6": {
+ "type": "array",
+ "description": "An optional array of workflow preset objects. Used to execute configure, build, test, and package presets in order. Available in version 6 and higher.",
+ "allOf": [
+ { "$ref": "#/definitions/workflowPresetsItemsV6" }
+ ],
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {},
+ "vendor": {},
+ "displayName": {},
+ "description": {},
+ "steps": {}
+ },
+ "required": [
+ "name",
+ "steps"
+ ],
+ "additionalProperties": false
+ }
+ },
"condition": {
"anyOf": [
{
diff --git a/Help/release/dev/cmake-presets-workflow.rst b/Help/release/dev/cmake-presets-workflow.rst
new file mode 100644
index 0000000..db93d72
--- /dev/null
+++ b/Help/release/dev/cmake-presets-workflow.rst
@@ -0,0 +1,4 @@
+cmake-presets-workflow
+----------------------
+
+* The :manual:`cmake-presets(7)` format now supports a ``workflowPresets`` field.