On Wed, Nov 26, 2008 at 7:27 PM, Bill Hoffman <span dir="ltr">&lt;<a href="mailto:bill.hoffman@kitware.com">bill.hoffman@kitware.com</a>&gt;</span> 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;">
<div class="Ih2E3d">Robert Dailey wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I have about 20 directories that contain source files. However, the FILE() call I make to each directory will have a different glob expression. I need to be able to do FILE( GLOB ..... ) about 20 times and each time have it append to the existing variable I give it. Is this possible? What would be the recommended way of accumulating a list of files in all 20 directories?<br>

<br>
</blockquote>
<br></div>
find . -name &quot;*.c&quot; &gt; source_files.txt<br>
edit source_files.txt and put that list of files exiplicitly into a CMakeLists.txt file.<br>
<br>
file(GLOB is a bad way to get source lists for CMake. &nbsp; CMake has no way of knowing when new files have been put in the directory.</blockquote></div><br>But unless I am missing a fundamental feature somewhere, GLOB still seems to be the better alternative. While it may not intrinsically know when new files have appeared on the filesystem, the programmer can simply re-run the CMake command to get an updated project with the newly added source files without editing the CMakeLists.txt file directly. This is better than the alternative, which is a hard-coded list of project files in the CMake script.<br>