[CMake] Operator Precedence

Michael Hertling mhertling at online.de
Mon Mar 12 21:24:06 EDT 2012


On 03/12/2012 07:32 PM, Robert Dailey wrote:
> What is the precedence for logical operators (specifically in IF
> conditions)?
> 
> Consider: STREQUAL, AND, OR (plus any others)

Documentation of IF():

"...there is a traditional order of precedence. Parenthetical
expressions are evaluated first followed by unary operators such as
EXISTS, COMMAND, and DEFINED. Then any EQUAL, LESS, GREATER, STRLESS,
STRGREATER, STREQUAL, MATCHES will be evaluated. Then NOT operators and
finally AND, OR operators will be evaluated."

Documentation of WHILE():

"The condition is evaluated using the same logic as the if command."

Regards,

Michael


More information about the CMake mailing list