CMake: what is the purpose of matching a variable with itself?

I saw the following snippet of CMake code in the definition of the CHECK_C_SOURCE_COMPILES macro :

IF("${VAR}" MATCHES "^${VAR}$") ... 

What is the purpose of this code and will it not always be successful?

+4
source share
1 answer

from the CMake mailing list

this is definitely not always true. The variable you are testing may contain a "non-evaluated" var or some special regular character (*,?, ...)

+3
source

Source: https://habr.com/ru/post/1436011/


All Articles