What I did (and solved the issue) is:<br> file(READ "zconf.in.h" ZCONF_H)<br>STRING(REPLACE "HAVE_STD_HEADERS_H" ${HAVE_STD_HEADERS_H} "${ZCONF_H}")<br>file(WRITE "zconf.test" "${ZCONF_H}")<br>
<br>Especially the quotes around the variable are important as otherwise CMake think it's an array and not a string... I think :)<br><br><br><br><br><div class="gmail_quote">2009/3/25 David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">";" is the CMake list element separator character. The ";" are still there in the variable, you probably just can't see them with your processing code that comes after reading in the file...<br>
<br>
<div>You can replace semi-colons like this with escaped semi-colons:</div><div><div> STRING(REGEX REPLACE ";" "\\\\;" ZCONF_H "${ZCONF_H}")</div><div><br></div><div>Then CMake will treat the variable ZCONF_H as one large string that has embedded (escaped) semi-colons in it.</div>
<div><br></div><div><br></div><div>HTH,</div><div>David</div><font color="#888888"><div><br></div><div><br></div></font></div><div><div class="gmail_quote"><div><div></div><div class="h5">On Sun, Mar 22, 2009 at 6:07 AM, Steven Van Ingelgem <span dir="ltr"><<a href="mailto:steven@vaningelgem.be" target="_blank">steven@vaningelgem.be</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">Hi,<br><br><br>I'm trying to read in a C-header file with "file(READ)":<br>
file(READ "zconf.in.h" ZCONF_H)<br>
<br>!! But this variable contains no ";" whatsoever?<br><br>How can I ask to read it in completely?<br>
<br><br>Thanks,<br><font color="#888888">Steven<br>
</font><br></div></div><div class="im">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></div></blockquote></div><br></div>
</blockquote></div><br>