[CMake] if+or: Unknown arguments specified

Michael Wild themiwi at gmail.com
Fri Jun 10 03:50:31 EDT 2011


On 06/10/2011 09:23 AM, Mathieu Malaterre wrote:
> Hi all,
> 
>   I am trying to write a simple if ( or ) expression but this leads to
> the following error message:
> ...
> CMake Warning (dev) at CMakeLists.txt:10 (if):
>   given arguments:
> 
>     "var" "STREQUAL" "foo" "or" "var" "STREQUAL" "bla"
> 
>   Unknown arguments specified
> ...
> 
> Here is a simple test to reproduce:
> 
> project(test)
> 
> set(var "foo")
> if(var STREQUAL "foo")
>   message("FOO")
> endif()
> if(var STREQUAL "bla")
>   message("BLA")
> endif()
> if(var STREQUAL "foo" or var STREQUAL "bla")
>   message("FOO or BLA")
> endif()
> 
> How should I do the test with the OR expression ?
> 
> Thanks,

Use all-caps OR.

Michael


More information about the CMake mailing list