diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-10-19 18:01:40 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-10-21 14:37:08 (GMT) |
commit | 920d18004731c97a828a937e2074b6882ffeb20d (patch) | |
tree | 300fb2ca724c39e0f9498736f8b48d0a5bf62fa0 /Tests/RunCMake/CMakePresets | |
parent | ec3b3d2c2f16397b9a40f79a9783f3d207088b93 (diff) | |
download | CMake-920d18004731c97a828a937e2074b6882ffeb20d.zip CMake-920d18004731c97a828a937e2074b6882ffeb20d.tar.gz CMake-920d18004731c97a828a937e2074b6882ffeb20d.tar.bz2 |
CMakePresets.json: Allow boolean for cache variable value
Fixes: #21327
Diffstat (limited to 'Tests/RunCMake/CMakePresets')
-rw-r--r-- | Tests/RunCMake/CMakePresets/CMakePresets.json.in | 16 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresets/Good-stdout.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresets/Good.cmake | 6 |
3 files changed, 28 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakePresets/CMakePresets.json.in b/Tests/RunCMake/CMakePresets/CMakePresets.json.in index 8bfc602..18b9c3a 100644 --- a/Tests/RunCMake/CMakePresets/CMakePresets.json.in +++ b/Tests/RunCMake/CMakePresets/CMakePresets.json.in @@ -46,6 +46,22 @@ "type": "BOOL", "value": "OFF" }, + "TEST_BOOL_TRUE": true, + "TEST_BOOL_FALSE": false, + "TEST_TYPED_BOOL_TRUE": { + "type": "STRING", + "value": true + }, + "TEST_TYPED_BOOL_FALSE": { + "type": "STRING", + "value": false + }, + "TEST_UNTYPED_BOOL_TRUE": { + "value": true + }, + "TEST_UNTYPED_BOOL_FALSE": { + "value": false + }, "TEST_PRESET_NAME": { "type": "STRING", "value": "x${presetName}x" diff --git a/Tests/RunCMake/CMakePresets/Good-stdout.txt b/Tests/RunCMake/CMakePresets/Good-stdout.txt index ce6189e..7adf1ca 100644 --- a/Tests/RunCMake/CMakePresets/Good-stdout.txt +++ b/Tests/RunCMake/CMakePresets/Good-stdout.txt @@ -1,5 +1,7 @@ Preset CMake variables: + TEST_BOOL_FALSE:BOOL="FALSE" + TEST_BOOL_TRUE:BOOL="TRUE" TEST_DOLLAR="\$" TEST_D_ENV_REF="xEnvironment variablex" TEST_D_ENV_REF_P="" @@ -32,6 +34,10 @@ Preset CMake variables: TEST_TRAILING_DOLLAR="a \$" TEST_TRAILING_UNKNOWN_NAMESPACE="\$unknown{namespace" TEST_TRUE:BOOL="TRUE" + TEST_TYPED_BOOL_FALSE:STRING="FALSE" + TEST_TYPED_BOOL_TRUE:STRING="TRUE" + TEST_UNTYPED_BOOL_FALSE="FALSE" + TEST_UNTYPED_BOOL_TRUE="TRUE" Preset environment variables: diff --git a/Tests/RunCMake/CMakePresets/Good.cmake b/Tests/RunCMake/CMakePresets/Good.cmake index d8e3e2d..55b85da 100644 --- a/Tests/RunCMake/CMakePresets/Good.cmake +++ b/Tests/RunCMake/CMakePresets/Good.cmake @@ -8,6 +8,12 @@ test_variable(TEST_SOURCE_PARENT_DIR "PATH" "${_parent_dir}") test_variable(TEST_SOURCE_LIST "FILEPATH" "${CMAKE_SOURCE_DIR}/CMakeLists.txt") test_variable(TEST_TRUE "BOOL" "TRUE") test_variable(TEST_OFF "BOOL" "OFF") +test_variable(TEST_BOOL_TRUE "BOOL" "TRUE") +test_variable(TEST_BOOL_FALSE "BOOL" "FALSE") +test_variable(TEST_TYPED_BOOL_TRUE "STRING" "TRUE") +test_variable(TEST_TYPED_BOOL_FALSE "STRING" "FALSE") +test_variable(TEST_UNTYPED_BOOL_TRUE "UNINITIALIZED" "TRUE") +test_variable(TEST_UNTYPED_BOOL_FALSE "UNINITIALIZED" "FALSE") test_variable(TEST_PRESET_NAME "STRING" "xGoodx") test_variable(TEST_GENERATOR "UNINITIALIZED" "x${CMAKE_GENERATOR}x") test_variable(TEST_DOLLAR "UNINITIALIZED" "$") |