if — CMake 3.23.0-rc3 Documentation
cmake.org › cmake › helpif — CMake 3.23.0-rc2 Documentation if ¶ Conditionally execute a group of commands. Synopsis ¶ if (<condition>) <commands> elseif (<condition>) # optional block, can be repeated <commands> else () # optional block <commands> endif () Evaluates the condition argument of the if clause according to the Condition syntax described below.
CMake syntax — CMake Workshop
enccs.github.io › cmake-workshop › cmake-syntaxSince all variables in CMake are strings, the syntax for if and foreach appears in a few different variants. if if(<condition>) # <commands> elseif(<condition>) # optional block, can be repeated # <commands> else() # optional block # <commands> endif() The truth value of the conditions in the if and elseif blocks is determined by boolean operators.