On Wed, Aug 15, 2012 at 3:31 PM, Rolf Eike Beer <e...@sf-mail.de> wrote:
> David Cole wrote: > > On Wed, Aug 15, 2012 at 1:28 PM, Rolf Eike Beer <e...@sf-mail.de> wrote: > > > Bill Hoffman wrote: > > > > > > > http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=97c338bac910d087eff9b16 > > > 0e> > > > > 3b68f2eeee482a5 > > > > > > > > > > > > http://open.cdash.org/testDetails.php?test=156453780&build=2517168 > > > > > > > > CMake Error at /export/home/kitware/Dashboards/My > > > > > > > > Tests-SunOSsnv_135.11i86pc-gcc/CMake/Modules/FindX11.cmake:329 > (list): > > > > list sub-command REMOVE_DUPLICATES requires list to be present. > > > > > > > > Call Stack (most recent call first): > > > > /export/home/kitware/Dashboards/My > > > > > > > Tests-SunOSsnv_135.11i86pc-gcc/CMake/Modules/CMakeBackwardCompatibilityC.c > > > ma> > > > > ke:56 (include) > > > > > > > > CMakeLists.txt:5 (project) > > > > > > I'll work around this for now, but I wonder if the restriction in > > > list(REMOVE_DUPLICATES) actually makes sense. We don't give an error if > > > there > > > are no duplicates, why should we give an error if there are no items? > > > > Is it that there are no items, or that there is not even a list with that > > name? > > In line 151 of FindX11.cmake there is a > > set(X11_LIBRARY_DIR "") > > so the variable should exists. > > Eike > -- > -- > > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers > 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. 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. But really, we should probably just be silent if there *is* a variable of that name, and it has no items. It would be a behavior change -- how strict should we be for backwards compatibility in this case? :-) -- 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. 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. Thx, David
-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers