<div dir="ltr">So I submitted a patch to add a new unset() command to CMake.&nbsp; The command will unset normal or cache variables (causing them to become undefined).&nbsp; The command also supports unsetting environment variables, in case anyone has to do that.<br>
<br>The primary use case that drove me to implement this was this:<br><br>find_library(FOO_LIBRARY foo)<br>if(MSVC OR SEARCH_FOO_DEBUG)<br>&nbsp;&nbsp;&nbsp; find_library(FOO_LIBRARY_DEBUG food)<br>else()<br>&nbsp;&nbsp;&nbsp; unset(FOO_LIBRARY_DEBUG)<br>
&nbsp;&nbsp;&nbsp; set(FOO_LIBRARY_DEBUG ${FOO_LIBRARY})<br>endif()<br><br><a href="http://public.kitware.com/Bug/view.php?id=7507">http://public.kitware.com/Bug/view.php?id=7507</a><br><br>Comments?<br><br>-- <br>Philip Lowman<br>
</div>