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

Johan Björk phb at spotify.com
Fri Feb 4 13:03:24 EST 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20110204/6b8a0825/attachment.html>


More information about the cmake-developers mailing list