Jian Wang wrote:

    Why is IF("${VARIABLE}" MATCHES "^${VARIABLE}$") used instead of IF(
    ${VARIABLE} STREQUAL ${VARIABLE} ) (which would always return true)?
    I'm not sure of use case but I'd say it's checking for special
    characters in VARIABLE.

If it's checking for special characters then I have to say that it's not the right way. For example, if VARIABLE == "a/b" then the IF statement is still TRUE.

It is checking to see if the VARIABLE has a value at all. It is old code before we had IF(DEFINED VARIABLE) but works with all versions of CMake.

-Bill

_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to