Skip to content
Snippets Groups Projects
Commit fa16b462 authored by Brad King's avatar Brad King
Browse files

Tests: Fix RunCMake.CMakePresets example PATH format

Since commit 94c955e5 (Tests: Test the CMakePresets.json example in
the documentation, 2020-10-09, v3.19.0-rc1~8^2) we transform the
documented preset example for testing by replacing the generator.
Extend the transformation with a step to fix `PATH` env var syntax.
parent 41f9486e
No related branches found
No related tags found
No related merge requests found
......@@ -316,6 +316,9 @@ run_cmake_presets(OptionalGeneratorField -G "${RunCMake_GENERATOR}")
# 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}")
if(CMAKE_HOST_WIN32)
string(REPLACE [["PATH": "$env{HOME}/ninja/bin:$penv{PATH}"]] [["PATH": "$env{HOME}/ninja/bin;$penv{PATH}"]] _example "${_example}")
endif()
file(WRITE "${RunCMake_BINARY_DIR}/example.json.in" "${_example}")
set(CMakePresets_FILE "${RunCMake_BINARY_DIR}/example.json.in")
run_cmake_presets(DocumentationExample --preset=default)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment