[CMake] IF how?

Brandon J. Van Every bvanevery at gmail.com
Mon Feb 19 17:51:47 EST 2007


klaas.holwerda wrote:
> Hi,
>
> Cmake 2.4 patch 5
>
> I am getting different behaviour on Linux compared to windows. From 
> the docs i understand that the next should end up with the message 
> "fine".
> Is that true? I get the else answer??
>
> SET( myvar 0 )
> IF( myvar EQUAL 0 )
>     MESSAGE( "fine" )
> ELSE( myvar EQUAL 0 )
>     MESSAGE( "fine" )
> ENDIF( myvar EQUAL 0 )
>
> For me only works:
> IF( ${myvar} STREQUAL "0" )
> etc.

Try

IF(myvar)
   // blah != 0
ELSE(myvar)
  // blah == 0
ENDIF(myvar)


Cheers,
Brandon Van Every



More information about the CMake mailing list