[cmake-developers] Bug in FILE(STRINGS)?

David Cole david.cole at kitware.com
Fri Feb 4 13:44:49 EST 2011


Don't you mean:
LIST(GET FOO 0 TEST)

FOO is the file(STRINGS result. "test" is the filename...


On Fri, Feb 4, 2011 at 1:03 PM, Johan Björk <phb at spotify.com> wrote:

> Hi everyone,
>
> It seems the FILE(STRINGS) function does not properly return a list when
> there is only one item.
>
> Example cmake file:
> FILE(WRITE test "hello")
> FILE(STRINGS test FOO)
> message(${FOO})
> LIST(GET test 0 TEST)
> message(${TEST})
>
> Returns:
> :~ phb$ cmake -P test.cmake
> hello
> NOTFOUND
>
> This is with cmake 2.8.4-rc2 as well as 2.8.3.
> Is there a better way to write the above code? (Ie, get the first element,
> no matter if it's a list or not?)
>
> Thanks
> /Johan
>
>
>
> _______________________________________________
> cmake-developers mailing list
> cmake-developers at cmake.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20110204/2b118535/attachment.html>


More information about the cmake-developers mailing list