title: Ternary operator in CMake's generator expressions
body: <p>Cmake's <a href="https://cmake.org/cmake/help/v3.0/manual/cmake-generator-expressions.7.html">generator expressions</a> allow me to use logical expressions within certain function calls. For instance, if I want to add the <code>/MTd</code> compiler flag in Debug mode, I can say</p>
  
  <pre><code>add_compile_options($&lt;$&lt;CONFIG:Debug&gt;:/MTd&gt;)
  </code></pre>
  
  <p>If <code>CONFIG</code> equals "Debug", this will call <code>add_compile_options</code> with the value "/MTd", otherwise with an empty string.</p>
  
  <p>But usually, I don't want to decide between a value and the empty string, but between two values. In the example above, if <code>CONFIG</code> is <em>not</em> "Debug", I want to pass <code>/MT</code> (without the trailing d). I'd love to have a syntax like this:</p>
  
  <pre><code>add_compile_options($&lt;$&lt;CONFIG:Debug&gt;:/MTd:/MT&gt;)
  </code></pre>
  
  <p>Note that the above is <strong>not valid code</strong> according to the CMake specs. The best I have come up with that actually works is this:</p>
  
  <pre><code>add_compile_options($&lt;$&lt;CONFIG:Debug&gt;:/MTd&gt;$&lt;$&lt;NOT:$&lt;CONFIG:Debug&gt;&gt;:/MT&gt;)
  </code></pre>
  
  <p>This seems awfully redundant to me. Is there a shorter, more readable way to decide between two values?</p>
  
  <p>Note: I realize that in this special case, I could write this:</p>
  
  <pre><code>add_compile_options(/MT$&lt;$&lt;CONFIG:Debug&gt;:d&gt;)
  </code></pre>
  
  <p>But this seems rather hacky to me and only works in those cases where one option is a substring of the other.</p>