<div dir="ltr">I feel like this is a really dumb question, but I've got myself wrapped around the axel....<div><br></div><div>I'd like to use a negative conditional on a variable that may or may not be defined...  say USE_SYSTEM_FOO</div>
<div><br></div><div>So, I'd like to do something like this...</div><div><br></div><div>IF( NOT ${USE_SYSTEM_FOO} )</div><div>    # Build my own FOO</div><div>ENDIF()</div><div><br></div><div>However, this does not work as desired.  On the other hand, the following version does have the desired behavior (shouldn't these be the same?).</div>
<div><br></div><div><div>IF( ${USE_SYSTEM_FOO} )</div><div>ELSE()</div><div>    # Build my own FOO</div><div>ENDIF()</div></div><div><br></div><div>I tried a couple of combinations with DEFINED thrown in.  They didn't work as desired either.  I didn't chase after a compound conditional like the following simply due to ugliness....</div>
<div><br></div><div><div>IF( NOT DEFINED ${USE_SYSTEM_FOO} OR NOT ${USE_SYSTEM_FOO} )</div><div>    # Build my own FOO</div><div>ENDIF()</div></div><div><br></div><div>What is the CMake idiomatic way to do this?</div><div>
<br></div><div>BTW, I'm going to do a bunch of these, and I'd like to surround them with a global USE_SYSTEM_LIBRARIES, so solutions that don't get exponentially uglier with linear increases in complexity are desired.</div>
<div><br></div><div>Rob</div></div>