summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-presets.7.rst53
-rw-r--r--Help/manual/presets/schema.json76
2 files changed, 93 insertions, 36 deletions
diff --git a/Help/manual/cmake-presets.7.rst b/Help/manual/cmake-presets.7.rst
index 93e1151..62c4b7c 100644
--- a/Help/manual/cmake-presets.7.rst
+++ b/Help/manual/cmake-presets.7.rst
@@ -130,34 +130,34 @@ Format
the ``architecture`` field instead.
``architecture``
+ ``toolset``
- An optional string representing the platform name to use for generators
- that support platforms.
+ Optional fields representing the platform and toolset, respectively, for
+ generators that support them. Each may be either a string or an object
+ with the following fields:
- ``toolset``
+ ``value``
- An optional string representing the toolset name to use for generators
- that support toolsets.
+ An optional string representing the value.
- ``cmakeGeneratorConfig``
+ ``strategy``
- An optional string telling CMake how to handle the ``architecture`` and
- ``toolset`` fields. Valid values are:
+ An optional string telling CMake how to handle the ``architecture`` or
+ ``toolset`` field. Valid values are:
- ``"default"``
+ ``"set"``
- Set the platform and toolset using the ``architecture`` and ``toolset``
- fields respectively. On non-Visual Studio generators, this will result
- in an error if ``architecture`` or ``toolset`` are set.
+ Set the respective value. This will result in an error for generators
+ that do not support the respective field.
- ``"ignore"``
+ ``"external"``
- Do not set the platform or toolset at all, even on Visual Studio
- generators. This is useful if, for example, a preset uses the Ninja
- generator, and an IDE knows how to set up the Visual C++ environment
- from the ``architecture`` and ``toolset`` fields. In that case, CMake
- will ignore ``architecture`` and ``toolset``, but the IDE can use them
- to set up the environment before invoking CMake.
+ Do not set the value, even if the generator supports it. This is
+ useful if, for example, a preset uses the Ninja generator, and an IDE
+ knows how to set up the Visual C++ environment from the
+ ``architecture`` and ``toolset`` fields. In that case, CMake will
+ ignore the field, but the IDE can use them to set up the environment
+ before invoking CMake.
``binaryDir``
@@ -176,9 +176,10 @@ Format
``cacheVariables``
An optional map of cache variables. The key is the variable name (which
- may not be an empty string), and the value is either ``null``, a string
- representing the value of the variable (which supports macro expansion),
- or an object with the following fields:
+ may not be an empty string), and the value is either ``null``, a boolean
+ (which is equivalent to a value of ``"TRUE"`` or ``"FALSE"`` and a type
+ of ``BOOL``), a string representing the value of the variable (which
+ supports macro expansion), or an object with the following fields:
``type``
@@ -186,7 +187,8 @@ Format
``value``
- A required string representing the value of the variable. This field
+ A required string or boolean representing the value of the variable.
+ A boolean is equivalent to ``"TRUE"`` or ``"FALSE"``. This field
supports macro expansion.
Cache variables are inherited through the ``inherits`` field, and the
@@ -306,6 +308,11 @@ Format
Path to the project source directory's parent directory.
+ ``${sourceDirName}``
+
+ The last filename component of ``${sourceDir}``. For example, if
+ ``${sourceDir}`` is ``/path/to/source``, this would be ``source``.
+
``${presetName}``
Name specified in the preset's ``name`` field.
diff --git a/Help/manual/presets/schema.json b/Help/manual/presets/schema.json
index 564c94c..57b063e 100644
--- a/Help/manual/presets/schema.json
+++ b/Help/manual/presets/schema.json
@@ -85,19 +85,57 @@
"description": "An optional string representing the generator to use for the preset. If generator is not specified, it must be inherited from the inherits preset (unless this preset is hidden). Note that for Visual Studio generators, unlike in the command line -G argument, you cannot include the platform name in the generator name. Use the architecture field instead."
},
"architecture": {
- "type": "string",
- "description": "An optional string representing the platform name to use for Visual Studio generators."
+ "anyOf": [
+ {
+ "type": "string",
+ "description": "An optional string representing the platform for generators that support it."
+ },
+ {
+ "type": "object",
+ "description": "An optional object representing the platform for generators that support it.",
+ "properties": {
+ "value": {
+ "type": "string",
+ "description": "An optional string representing the value."
+ },
+ "strategy": {
+ "type": "string",
+ "description": "An optional string telling CMake how to handle the field. Valid values are: \"set\" Set the respective value. This will result in an error for generators that do not support the respective field. \"external\" Do not set the value, even if the generator supports it. This is useful if, for example, a preset uses the Ninja generator, and an IDE knows how to set up the Visual C++ environment from the architecture and toolset fields. In that case, CMake will ignore the field, but the IDE can use them to set up the environment before invoking CMake.",
+ "enum": [
+ "set",
+ "external"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ ]
},
"toolset": {
- "type": "string",
- "description": "An optional string representing the toolset name to use for Visual Studio generators."
- },
- "cmakeGeneratorConfig": {
- "type": "string",
- "description": "An optional string telling CMake how to handle the architecture and toolset fields. Valid values are: \"default\": Set the platform and toolset using the architecture and toolset fields respectively. On non-Visual Studio generators, this will result in an error if architecture or toolset are set. \"ignore\": Do not set the platform or toolset at all, even on Visual Studio generators. This is useful if, for example, a preset uses the Ninja generator, and an IDE knows how to set up the Visual C++ environment from the architecture and toolset fields. In that case, CMake will ignore architecture and toolset, but the IDE can use them to set up the environment before invoking CMake.",
- "enum": [
- "default",
- "ignore"
+ "anyOf": [
+ {
+ "type": "string",
+ "description": "An optional string representing the toolset for generators that support it."
+ },
+ {
+ "type": "object",
+ "description": "An optional object representing the toolset for generators that support it.",
+ "properties": {
+ "value": {
+ "type": "string",
+ "description": "An optional string representing the value."
+ },
+ "strategy": {
+ "type": "string",
+ "description": "An optional string telling CMake how to handle the field. Valid values are: \"set\" Set the respective value. This will result in an error for generators that do not support the respective field. \"external\" Do not set the value, even if the generator supports it. This is useful if, for example, a preset uses the Ninja generator, and an IDE knows how to set up the Visual C++ environment from the architecture and toolset fields. In that case, CMake will ignore the field, but the IDE can use them to set up the environment before invoking CMake.",
+ "enum": [
+ "set",
+ "external"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
]
},
"binaryDir": {
@@ -119,6 +157,10 @@
"description": "Setting a variable to null causes it to not be set, even if a value was inherited from another preset."
},
{
+ "type": "boolean",
+ "description": "A boolean representing the value of the variable. Equivalent to \"TRUE\" or \"FALSE\"."
+ },
+ {
"type": "string",
"description": "A string representing the value of the variable (which supports macro expansion)."
},
@@ -131,8 +173,16 @@
"description": "An optional string representing the type of the variable. It should be BOOL, FILEPATH, PATH, STRING, or INTERNAL."
},
"value": {
- "type": "string",
- "description": "A required string representing the value of the variable. This field supports macro expansion."
+ "anyOf": [
+ {
+ "type": "boolean",
+ "description": "A required boolean representing the value of the variable. Equivalent to \"TRUE\" or \"FALSE\"."
+ },
+ {
+ "type": "string",
+ "description": "A required string representing the value of the variable. This field supports macro expansion."
+ }
+ ]
}
},
"required": [