See also the details in this thread:<br><a href="http://www.cmake.org/pipermail/cmake/2007-May/014222.html">http://www.cmake.org/pipermail/cmake/2007-May/014222.html</a><br><br>...which describes how to iterate a text file line by line using "FILE(READ", converting to a list preserving existing semi-colons, and iterating the lines with cmake FOREACH...
<br><br>HTH,<br>David<br><br><div><span class="gmail_quote">On 7/22/07, <b class="gmail_sendername">Brandon Van Every</b> <<a href="mailto:bvanevery@gmail.com">bvanevery@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 7/22/07, Mathieu Malaterre <<a href="mailto:mathieu.malaterre@gmail.com">mathieu.malaterre@gmail.com</a>> wrote:<br>> Hi Brandon,<br>><br>> I think you can use this trick to work around your issue:<br>
><br>> <a href="http://www.cmake.org/pipermail/cmake/2007-May/014317.html">http://www.cmake.org/pipermail/cmake/2007-May/014317.html</a><br>><br>> STRING(REGEX REPLACE "\r?\n" ";" ENT "${input}")
<br>> FOREACH(line ${ENT})<br>> # do the match on each line<br><br>Thanks for the cross-platform \r\n CR+LF hint. Last night I tried to<br>match \n, but it didn't seem to be working. Actually it was matching
<br>fine, but my output only had \n in it, and a Windows shell needs CR+LF<br>to go down a line.<br><br>Injecting semicolons is really dangerous though. What if your file<br>already has semicolons? In my code, FILE(...) followed by
<br>STRING(REGEX ...) is destroying the semicolons in the file. I need to<br>get to the bottom of that.<br><br><br>Cheers,<br>Brandon Van Every<br>_______________________________________________<br>CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br><a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>