[CMake] if+or: Unknown arguments specified

Mathieu Malaterre mathieu.malaterre at gmail.com
Fri Jun 10 03:56:24 EDT 2011


On Fri, Jun 10, 2011 at 9:50 AM, Michael Wild <themiwi at gmail.com> wrote:
> 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.
>

Thanks ! I was relying too much on my vim syntax highlighting


-- 
Mathieu


More information about the CMake mailing list