diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/CMakePresets/DocumentationExample.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresets/RunCMakeTest.cmake | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakePresets/DocumentationExample.cmake b/Tests/RunCMake/CMakePresets/DocumentationExample.cmake new file mode 100644 index 0000000..1f2fc00 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/DocumentationExample.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(MY_CACHE_VARIABLE "BOOL" "OFF") diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake index 4b430b3..18ea093 100644 --- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake @@ -1,3 +1,5 @@ +cmake_minimum_required(VERSION 3.19) # CMP0053 + include(RunCMake) # Fix Visual Studio generator name @@ -214,3 +216,10 @@ unset(CMakePresets_WARN_UNUSED_CLI) set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/Debug.json.in") run_cmake_presets(NoDebug) run_cmake_presets(Debug) + +# Test the example from the documentation +file(READ "${RunCMake_SOURCE_DIR}/../../../Help/manual/presets/example.json" _example) +string(REPLACE "\"generator\": \"Ninja\"" "\"generator\": \"@RunCMake_GENERATOR@\"" _example "${_example}") +file(WRITE "${RunCMake_BINARY_DIR}/example.json.in" "${_example}") +set(CMakePresets_FILE "${RunCMake_BINARY_DIR}/example.json.in") +run_cmake_presets(DocumentationExample --preset=default) |