If you do a FILE(GLOB cmake will not detect when files are added to the directory and will *not* re-run automatically. If you explicitly list your files in CMakeLists.txt, then when it changes, cmake re-runs automatically as part of a build.
<br><br>Don&#39;t use the FILE(GLOB technique unless you are willing to live with this fact...<br><br>HTH,<br>David<br><br><br><div><span class="gmail_quote">On 1/18/08, <b class="gmail_sendername">Stuart Herring</b> &lt;
<a href="mailto:cmake@stuartherring.com">cmake@stuartherring.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><span class="q">
On Jan 18, 2008 11:43 PM, Yang, Y. &lt;<a href="mailto:Y.Yang@tue.nl" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Y.Yang@tue.nl</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

For example, SET( MY_SRCS mydir/*.c)<br><br>if CMake can do this, I don&#39;t have to modify the CMakeLists.txt every<br>time when I add new files to mydir.<br><br></blockquote></div></span>That&#39;s not exactly a regular expression - it&#39;s a glob.
<br>
In any case, FILE(GLOB ...) is what you want. (as seen at <a href="http://www.cmake.org/HTML/Documentation.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.cmake.org/HTML/Documentation.html
</a>)<br>
In this case FILE(GLOB MY_SRCS mydir/*.c)<br>
<br>
Although, personally I prefer to explicitly add files, that way I know I haven&#39;t inadvertently included something I didn&#39;t want.<br><br>Regards,<br><span class="sg">Stuart.<br>
</span><br>_______________________________________________<br>CMake mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:CMake@cmake.org">CMake@cmake.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">
http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>