>
> if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
>> else()
>>... do something ...
>> endif()
>>
>
While you may need the empty if condition for something else, in this use
case specifically you could just as easily avoid the empty conditional
block and negate the expression with:
if(NOT
On 9/3/2015 1:59 AM, Petr Kmoch wrote:
Hi Philip.
You don't need one. This is a perfectly valid piece of CMake code:
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
else()
... do something ...
endif()
Thanks, Petr, that never occurred to me! No wonder I couldn't find it in
the documentation --
Hi Philip.
You don't need one. This is a perfectly valid piece of CMake code:
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
else()
... do something ...
endif()
Of course, the comment can be put in there, but you don't need any commands
between an if() and else() (or between any other pair of
Hi there,
Does CMake have a no-op command, like 'pass' in Python or ';' in C? I
sometimes want to create a construct like this:
IF(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# Under Windows we do nothing because blah blah blah
...no-op...
ELSE()
...do something...