From d6af1e83bc1fa7f8dcdeadcf57a91d8e5469dae8 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Fri, 9 Oct 2020 11:41:47 -0400 Subject: Help: Fix documentation of CMakePresets.json's cacheVariables cacheVariables is a map with variable names as the keys, but the example in the documentation was not updated to reflect this. Fix the example. --- Help/manual/cmake.1.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Help') diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 0f00f5327a..0eadff4fd2 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -190,13 +190,12 @@ source and build trees and generate a buildsystem: "description": "Default build using Ninja generator", "generator": "Ninja", "binaryDir": "${sourceDir}/build/default", - "cacheVariables": [ - { - "name": "MY_CACHE_VARIABLE", + "cacheVariables": { + "MY_CACHE_VARIABLE": { "type": "BOOL", "value": "OFF" } - ] + } } ] } -- cgit v1.2.1 From 94c955e508daa0ed84290cc1d3e946a74fde0e40 Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Fri, 9 Oct 2020 15:35:54 -0400 Subject: Tests: Test the CMakePresets.json example in the documentation --- Help/manual/cmake.1.rst | 27 ++------------------------- Help/manual/presets/example.json | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 Help/manual/presets/example.json (limited to 'Help') diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 0eadff4fd2..b345db0490 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -174,31 +174,8 @@ source and build trees and generate a buildsystem: The files are a JSON document with an object as the root: - .. code-block:: json - - { - "version": 1, - "cmakeMinimumRequired": { - "major": 3, - "minor": 19, - "patch": 0 - }, - "configurePresets": [ - { - "name": "default", - "displayName": "Default Config", - "description": "Default build using Ninja generator", - "generator": "Ninja", - "binaryDir": "${sourceDir}/build/default", - "cacheVariables": { - "MY_CACHE_VARIABLE": { - "type": "BOOL", - "value": "OFF" - } - } - } - ] - } + .. literalinclude:: presets/example.json + :language: json The root object recognizes the following fields: diff --git a/Help/manual/presets/example.json b/Help/manual/presets/example.json new file mode 100644 index 0000000000..a299a06b5d --- /dev/null +++ b/Help/manual/presets/example.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "cmakeMinimumRequired": { + "major": 3, + "minor": 19, + "patch": 0 + }, + "configurePresets": [ + { + "name": "default", + "displayName": "Default Config", + "description": "Default build using Ninja generator", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/default", + "cacheVariables": { + "MY_CACHE_VARIABLE": { + "type": "BOOL", + "value": "OFF" + } + } + } + ] +} -- cgit v1.2.1