<div dir="ltr"><div><div>Hi Rob, <br><br>What about:<br><br><div>if( NOT USE_SYSTEM_FOO)</div><div> # Build my own FOO<br></div><div>endif()</div><br></div>Hth<br></div>Jc<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Jan 29, 2014 at 7:09 PM, Rob McDonald <span dir="ltr"><<a href="mailto:rob.a.mcdonald@gmail.com" target="_blank">rob.a.mcdonald@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div>Rob</div></font></span></div>
<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br><br clear="all"><br>-- <br>+1 919 869 8849<br>
</div>