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 <[email protected]> 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
> [email protected]
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
>
>
_______________________________________________
cmake-developers mailing list
[email protected]
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to