[CMake] No-op command?

Chuck Atkins chuck.atkins at kitware.com
Mon Sep 7 12:31:54 EDT 2015


>
> 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 CMAKE_SYSTEM_NAME MATCHES "Windows")
  ... do something ...
endif()

- Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150907/ec669e26/attachment.html>


More information about the CMake mailing list