Files
Marc Chevrier b24c60325a string(REGEX MATCH): Restore reporting of matches with semicolons
This was broken by refactoring in commit dab5e6ebb1 (introduce
cm::CMakeString class as helper for string() command, 2025-10-06,
v4.3.0-rc1~510^2~2).

Fixes: #27749
2026-04-13 11:32:18 -04:00

16 lines
387 B
CMake

cmake_policy(SET CMP0186 NEW)
function(check_output name expected)
set(output "${${name}}")
if(NOT output STREQUAL expected)
message(FATAL_ERROR "\"string(REGEX)\" set ${name} to \"${output}\", expected \"${expected}\"")
endif()
endfunction()
string(REGEX MATCH ".*" out "abcd;")
check_output(out "abcd;")
string(REGEX MATCHALL "^.*" out "abcd;")
check_output(out "abcd;")