Re: [CMake] No-op command?

2015-09-07 Thread Chuck Atkins
> > 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

Re: [CMake] No-op command?

2015-09-03 Thread Philip Semanchuk
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 --

Re: [CMake] No-op command?

2015-09-03 Thread Petr Kmoch
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

[CMake] No-op command?

2015-09-02 Thread Philip Semanchuk
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...