[CMake] parenthesized booleans?

Brandon Van Every bvanevery at gmail.com
Mon Oct 8 15:57:58 EDT 2007


Does CMake allow for statements like

IF((var1 OR var2) AND (var3 OR var4))

or any similar syntax?  When I try it in CMake 2.4.7, I get parse errors.

SET(istrue "yadda")
SET(isfalse "FALSE")
IF((istrue AND istrue) OR (isfalse AND isfalse))
MESSAGE("it works")
ELSE((istrue AND istrue) OR (isfalse AND isfalse))
MESSAGE("it's broken")
ENDIF((istrue AND istrue) OR (isfalse AND isfalse))

C:\devel\moz>cmake -P cond.cmake
CMake Error: Error in cmake code at
C:/devel/moz/cond.cmake:3:
Parse error.  Function missing ending ")".  Instead found left paren with text "
(".

{} and [] don't work either.  They parse, but they produce "it's broken".


Cheers,
Brandon Van Every


More information about the CMake mailing list