CMake: conditional and logical expression syntax.

c c-plus-plus cmake syntax

Mostly a page with a link – the reference page for if() and logical expressions is here, from CMake’s docs.

Of note – else() and endif() require parentheses. It is not required to place anything inside the parentheses.

Per legacy, the else() and endif() commands admit an optional argument. If used, it must be a verbatim repeat of the argument of the opening if command.

© Amy Tabb 2018 - 2023. All rights reserved. The contents of this site reflect my personal perspectives and not those of any other entity.