<div class="gmail_quote">On Wed, Aug 15, 2012 at 3:31 PM, Rolf Eike Beer <span dir="ltr"><<a href="mailto:eike@sf-mail.de" target="_blank">eike@sf-mail.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">David Cole wrote:<br>
> On Wed, Aug 15, 2012 at 1:28 PM, Rolf Eike Beer <<a href="mailto:eike@sf-mail.de">eike@sf-mail.de</a>> wrote:<br>
> > Bill Hoffman wrote:<br>
> ><br>
> > <a href="http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=97c338bac910d087eff9b16" target="_blank">http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=97c338bac910d087eff9b16</a><br>
> > 0e><br>
> > > 3b68f2eeee482a5<br>
> > ><br>
> > ><br>
> > > <a href="http://open.cdash.org/testDetails.php?test=156453780&build=2517168" target="_blank">http://open.cdash.org/testDetails.php?test=156453780&build=2517168</a><br>
> > ><br>
> > > CMake Error at /export/home/kitware/Dashboards/My<br>
> > ><br>
> > > Tests-SunOSsnv_135.11i86pc-gcc/CMake/Modules/FindX11.cmake:329 (list):<br>
> > >    list sub-command REMOVE_DUPLICATES requires list to be present.<br>
> > ><br>
> > > Call Stack (most recent call first):<br>
> > >    /export/home/kitware/Dashboards/My<br>
> ><br>
> > Tests-SunOSsnv_135.11i86pc-gcc/CMake/Modules/CMakeBackwardCompatibilityC.c<br>
> > ma><br>
> > > ke:56 (include)<br>
> > ><br>
> > >    CMakeLists.txt:5 (project)<br>
> ><br>
> > I'll work around this for now, but I wonder if the restriction in<br>
> > list(REMOVE_DUPLICATES) actually makes sense. We don't give an error if<br>
> > there<br>
> > are no duplicates, why should we give an error if there are no items?<br>
><br>
> Is it that there are no items, or that there is not even a list with that<br>
> name?<br>
<br>
</div>In line 151 of FindX11.cmake there is a<br>
<br>
  set(X11_LIBRARY_DIR "")<br>
<br>
so the variable should exists.<br>
<span class="HOEnZb"><font color="#888888"><br>
Eike<br>
-- </font></span><br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</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>
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>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers</a><br></blockquote></div><br><div><br></div><div>Well, I can't think of why anybody would care if REMOVE_DUPLICATES on an empty list produces a still empty list with no error.</div>
<div><br></div><div>I suppose somebody could have some code that relies on the error occurring... Perhaps the error is useful to some as a "possible typo in variable name" indicator.</div><div><br></div><div>But really, we should probably just be silent if there *is* a variable of that name, and it has no items.</div>
<div><br></div><div>It would be a behavior change -- how strict should we be for backwards compatibility in this case?</div><div><br></div><div><br></div><div>:-)  -- in the metaphysical sense, this gets into the question of what is a list... is a CMake variable value with exactly 0 or 1 "items" in it actually a list...? Or is it not a "list" until there are 2 or more items in it.</div>
<div><br></div><div><br></div><div>Silliness aside, I would be ok with changing the behavior to avoid the error in this particular case. Unless somebody has a real-world counter-argument where it is considered important to preserve our presently silly behavior.</div>
<div><br></div><div><br></div><div>Thx,</div><div>David</div><div><br></div>