[cmake-developers] FindX11 change breaks complex test
Rolf Eike Beer
eike at sf-mail.de
Wed Aug 15 16:28:54 EDT 2012
Rolf Eike Beer wrote:
> David Cole wrote:
>> On Wed, Aug 15, 2012 at 3:31 PM, Rolf Eike Beer wrote:
>>> David Cole wrote:
>>>> On Wed, Aug 15, 2012 at 1:28 PM, Rolf Eike Beer wrote:
>>>>> 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.
> >
> > 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.
>
> [...]
>
> > 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.
>
> That thing is even more silly. I just took the test for this
> (Tests/CMakeTests/ListTest.cmake.in) which looked like this:
>
> set(result bill andy bill brad ken ken ken)
> list(REMOVE_DUPLICATES result)
> TEST("REMOVE_DUPLICATES result" "bill;andy;brad;ken")
>
> Now I went and changed it to be
>
> list(REMOVE_DUPLICATES result foo bar baz)
>
> And guess what? It worked.
The same applies to SORT and REVERSE. I've pushed a fix for this as topic
list-command-argument-fixes and merged it to next.
For the empty variable: it looks like an empty variable and a not existing one
are the same. Is there a sane way to query this or should I just ignore it
anyway?
Eike
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20120815/9e4b3237/attachment.sig>
More information about the cmake-developers
mailing list