Thanks. I&#39;ll give this a try.<div><br></div><div>This isn&#39;t very intuitive, though. I was hoping for something a little less redundant. Because now I have to do this:</div><div><br></div><div>file( GLOB_RECURSE sources &quot;C:\foo\bar\source\*.h&quot; &quot;C:\foo\bar\source\*.ipp&quot; &quot;C:\foo\bar\source\*.hpp&quot; )</div>
<div><br></div><div>It just amazes me that this area of CMake is such a mystery.<br><br><div class="gmail_quote">On Sun, Mar 29, 2009 at 5:18 AM, Martin Costabel <span dir="ltr">&lt;<a href="mailto:costabel@wanadoo.fr">costabel@wanadoo.fr</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">The following seems to work:<br>
<br>
file(GLOB_RECURSE sources &quot;*.h&quot; &quot;*.hpp&quot; &quot;*.ipp&quot;)<br>
<br>
-- <br>
Martin<br>
<br>
Carlson Daniel wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Ok, I thought that Cmake supported the standard regular expression used by most GNU projects. The |-sign is an or-operator so the standard regular expression for this would be:<br>
<br>
^.*\.(h|hpp|ipp)$<br>
<br>
but now I realize that global expression and regular expression is not the same thing... Sorry for that! <br></div>
2009/3/29 Robert Dailey &lt;<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a> &lt;mailto:<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a>&gt;&gt;<div class="im"><br>
<br>
    I would prefer it just work. For large directory hierarchies,<br>
    running the glob twice is severely inefficient.<br>
<br>
    Thanks for the link to the documentation. Can anyone figure out a<br>
    way to glob for H, HPP, and IPP files in a single glob operation? Is<br>
    it even possible? I&#39;d be really disappointed it it wasn&#39;t.<br>
<br>
<br>
    On Sat, Mar 28, 2009 at 11:14 PM, James Bigler<br></div><div class="im">
    &lt;<a href="mailto:jamesbigler@gmail.com" target="_blank">jamesbigler@gmail.com</a> &lt;mailto:<a href="mailto:jamesbigler@gmail.com" target="_blank">jamesbigler@gmail.com</a>&gt;&gt; wrote:<br>
<br>
        The regular expression syntax is documented under the &#39;string&#39;<br>
        command<br>
        in the help files.  There&#39;s also a wiki entry:<br>
        <a href="http://vtk.org/Wiki/CMake_FAQ#Which_regular_expressions_are_supported_by_CMake.3F" target="_blank">http://vtk.org/Wiki/CMake_FAQ#Which_regular_expressions_are_supported_by_CMake.3F</a><br>
<br>
        I couldn&#39;t get file(GLOB_RECURSE sources &quot;*.(h|cpp)&quot;) to work.<br>
         &quot;*.h&quot;<br>
        would catch all the h files, &quot;*.cpp&quot; would catch all the cpp files,<br>
        but the expression above didn&#39;t catch both.<br>
<br>
        Robert, if the regular expression doesn&#39;t work for you, you could<br>
        always just run the command twice and concatenate the results:<br>
        file(GLOB_RECURSE h_files &quot;*.h&quot;)<br>
        file(GLOB_RECURSE hpp_ipp_files &quot;*.[hi]pp&quot;)<br>
        set(files &quot;${h_files}&quot; &quot;${hpp_ipp_files}&quot;)<br>
<br>
        James<br>
<br>
        On Sat, Mar 28, 2009 at 6:09 PM, Robert Dailey<br></div><div class="im">
        &lt;<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a> &lt;mailto:<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a>&gt;&gt; wrote:<br>
         &gt; Thank you.<br>
         &gt; For future reference, is the glob syntax for CMake documented<br>
        anywhere? If<br>
         &gt; it is, I have not been able to find it. Thanks again!<br>
         &gt;<br>
         &gt; On Sat, Mar 28, 2009 at 4:51 PM, Carlson Daniel<br></div>
        &lt;<a href="mailto:daniel.c.carlson@gmail.com" target="_blank">daniel.c.carlson@gmail.com</a> &lt;mailto:<a href="mailto:daniel.c.carlson@gmail.com" target="_blank">daniel.c.carlson@gmail.com</a>&gt;&gt;<div class="im">
<br>
         &gt; wrote:<br>
         &gt;&gt;<br>
         &gt;&gt; try:<br>
         &gt;&gt;<br>
         &gt;&gt; *.(h|hpp|ipp)<br>
         &gt;&gt;<br>
         &gt;&gt; 2009/3/28 Robert Dailey &lt;<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a><br></div>
        &lt;mailto:<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a>&gt;&gt;<div class="im"><br>
         &gt;&gt;&gt;<br>
         &gt;&gt;&gt; Can I get some help with this? Sorry to rush, but I&#39;m a bit<br>
        blocked. I<br>
         &gt;&gt;&gt; know some of you may be tempted to ask my why I&#39;m doing<br>
        this and possibly<br>
         &gt;&gt;&gt; even try to change my mind, but with all do respect, I<br>
        don&#39;t plan to avoid<br>
         &gt;&gt;&gt; globbing :)<br>
         &gt;&gt;&gt;<br>
         &gt;&gt;&gt; On Fri, Mar 27, 2009 at 7:07 PM, Robert Dailey<br></div>
        &lt;<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a> &lt;mailto:<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a>&gt;&gt;<div class="im"><br>
         &gt;&gt;&gt; wrote:<br>
         &gt;&gt;&gt;&gt;<br>
         &gt;&gt;&gt;&gt; I need to create a glob expression (For file( GLOB_RECURSE<br>
        ) ) that will<br>
         &gt;&gt;&gt;&gt; find files with the following extensions:<br>
         &gt;&gt;&gt;&gt; *.h<br>
         &gt;&gt;&gt;&gt; *.hpp<br>
         &gt;&gt;&gt;&gt; *.ipp<br>
         &gt;&gt;&gt;&gt; How can I format my glob expression to do this? I know for<br>
        HPP and IPP<br>
         &gt;&gt;&gt;&gt; files, my glob expression would be:<br>
         &gt;&gt;&gt;&gt; *.[hi]pp<br>
         &gt;&gt;&gt;&gt; However, this ignores all H files.<br>
         &gt;&gt;&gt;<br>
         &gt;&gt;&gt; _______________________________________________<br>
</div></blockquote>
</blockquote></div><br></div>