diff options
author | Brad King <brad.king@kitware.com> | 2021-05-05 13:45:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-05-05 14:13:35 (GMT) |
commit | fa16b462f1ac2df9f14596657ae81efc2c934675 (patch) | |
tree | 9f3ad0e4c9664c9bf100917f4bf0956e2e4fbfeb /Tests/RunCMake/CMakePresets | |
parent | 41f9486e61026275fcb9f559a6bc0fd36dcc48e6 (diff) | |
download | CMake-fa16b462f1ac2df9f14596657ae81efc2c934675.zip CMake-fa16b462f1ac2df9f14596657ae81efc2c934675.tar.gz CMake-fa16b462f1ac2df9f14596657ae81efc2c934675.tar.bz2 |
Tests: Fix RunCMake.CMakePresets example PATH format
Since commit 94c955e508 (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.
Diffstat (limited to 'Tests/RunCMake/CMakePresets')
-rw-r--r-- | Tests/RunCMake/CMakePresets/RunCMakeTest.cmake | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake index 02051d9..3b9806a 100644 --- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake @@ -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) |