In CMake, undefined variables can evaluate as false in simple
For comparison operations like
GREATER, undefined variables do not operate like “false”.
if(x LESS 1) message(FATAL_ERROR "undefined not less 1") endif()
No matter what value is compared to undefined variable “x”, the if() statement will not be true. As in most programming languages, a key best practice for CMake is to ensure variables are defined with a proper default value.