Don't you mean:<br>LIST(GET FOO 0 TEST)<br><br>FOO is the file(STRINGS result. "test" is the filename...<br><br><br><div class="gmail_quote">On Fri, Feb 4, 2011 at 1:03 PM, Johan Björk <span dir="ltr"><<a href="mailto:phb@spotify.com">phb@spotify.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi everyone,<div><br></div><div>It seems the FILE(STRINGS) function does not properly return a list when there is only one item.</div>
<div><br></div><div>Example cmake file:</div><div><div>FILE(WRITE test "hello")</div>
<div>FILE(STRINGS test FOO)</div><div>message(${FOO})</div><div>LIST(GET test 0 TEST)</div><div>message(${TEST})</div></div><div><br></div><div>Returns:</div><div><div>:~ phb$ cmake -P test.cmake </div><div>hello</div><div>

NOTFOUND</div></div><div><br></div><div>This is with cmake 2.8.4-rc2 as well as 2.8.3.</div><div>Is there a better way to write the above code? (Ie, get the first element, no matter if it's a list or not?)</div><div>
<br>
</div><div>Thanks</div><div>/Johan</div><font color="#888888"><div><br></div><div><br></div>
</font><br>_______________________________________________<br>
cmake-developers mailing list<br>
<a href="mailto:cmake-developers@cmake.org">cmake-developers@cmake.org</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers</a><br>
<br></blockquote></div><br>