Help: Fix regex in example of cmake-packages(7)
This change makes it work as intended as opposed to make the condition always true. This can be confirmed by running the following script:
[johel@sundown tmp]$ cat x.cmake
function(f)
set(valid_inputs abc 123)
foreach(input ${ARGV})
if(";${valid_inputs};" MATCHES input)
message("old valid: ${input}")
endif()
if(";${valid_inputs};" MATCHES ";${input};")
message("new valid: ${input}")
endif()
endforeach()
endfunction()
f("0;z;123;12;abc;ab;13;ac")
set(_supported_components Plot Table)
set(ClimbingStats_FIND_COMPONENTS Plot Table P T)
foreach(_comp ${ClimbingStats_FIND_COMPONENTS})
if(NOT ";${_supported_components};" MATCHES _comp)
message("old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE \"Unsupported component: ${_comp}\")")
endif()
if(NOT ";${_supported_components};" MATCHES ";${_comp};")
message("new invalid: set(ClimbingStats_NOT_FOUND_MESSAGE \"Unsupported component: ${_comp}\")")
endif()
endforeach()
[johel@sundown tmp]$ cmake -P x.cmake
new valid: 123
new valid: abc
old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: Plot")
old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: Table")
old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: P")
new invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: P")
old invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: T")
new invalid: set(ClimbingStats_NOT_FOUND_MESSAGE "Unsupported component: T")