<div class="gmail_quote">On Sun, Mar 29, 2009 at 11:46 PM, James Bigler <span dir="ltr">&lt;<a href="mailto:jamesbigler@gmail.com">jamesbigler@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Why doesn&#39;t *.[hi]pp work?  It works for me with ls and with file(GLOB):<br>
<br>
$ touch blah.hpp blah2.ipp<br>
$ ls *.[hi]pp<br>
blah.hpp        blah2.ipp<br>
<br>
Also, if the glob expressions get translated into regular expressions,<br>
is there any way we could get access to creating regular expressions?<br>
<br>
find . -E -regex &quot;&quot;<br>
<br>
That&#39;s essentially what&#39;s going on under the hood, right?<br>
<br>
I filed a bug to make the documentation more clear<br>
(<a href="http://public.kitware.com/Bug/view.php?id=8814" target="_blank">http://public.kitware.com/Bug/view.php?id=8814</a>).<br>
<br>
I also looked into the bash man page.  Curly braces {} are filed under<br>
Brace Expansion while the globbing characters (*,?,[]) were under<br>
Pathname Expansion.  The only discerning difference between the two<br>
expansions is whether or not the files have to exist (Brace Expansion<br>
allows for arbitrary string creation where the file names need not<br>
exist).<br>
<br>
I suspect CMake could add support for curly braces, but it might be<br>
easier to add support for regular expressions instead since the<br>
machinery already uses regex under the hood.</blockquote><div><br></div><div>But the goal for CMake in regards to globbing should be to implement what is most usable and most practical. Just because regex is easier to implement does not make it the most practical/useful path. Personally I think regex would be a bit overkill for most of the globbing I do. However, I think if the majority of the CMake community would find it useful then I would add regex.</div>
<div><br></div><div>In the end, as long as CMake isn&#39;t limiting my ability to solve issues within CMake&#39;s problem domain then I am happy.</div><div><br></div><div>Perhaps CMake could consider adding a file( REGEX ) or something for regular expressions. This would be a little more intuitive and usable, since mixing regex and glob is a bit misleading and confusing.</div>
</div>