Thanks. I'll give this a try.<div><br></div><div>This isn'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 "C:\foo\bar\source\*.h" "C:\foo\bar\source\*.ipp" "C:\foo\bar\source\*.hpp" )</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"><<a href="mailto:costabel@wanadoo.fr">costabel@wanadoo.fr</a>></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 "*.h" "*.hpp" "*.ipp")<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 <<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a> <mailto:<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a>>><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'd be really disappointed it it wasn't.<br>
<br>
<br>
On Sat, Mar 28, 2009 at 11:14 PM, James Bigler<br></div><div class="im">
<<a href="mailto:jamesbigler@gmail.com" target="_blank">jamesbigler@gmail.com</a> <mailto:<a href="mailto:jamesbigler@gmail.com" target="_blank">jamesbigler@gmail.com</a>>> wrote:<br>
<br>
The regular expression syntax is documented under the 'string'<br>
command<br>
in the help files. There'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't get file(GLOB_RECURSE sources "*.(h|cpp)") to work.<br>
"*.h"<br>
would catch all the h files, "*.cpp" would catch all the cpp files,<br>
but the expression above didn't catch both.<br>
<br>
Robert, if the regular expression doesn't work for you, you could<br>
always just run the command twice and concatenate the results:<br>
file(GLOB_RECURSE h_files "*.h")<br>
file(GLOB_RECURSE hpp_ipp_files "*.[hi]pp")<br>
set(files "${h_files}" "${hpp_ipp_files}")<br>
<br>
James<br>
<br>
On Sat, Mar 28, 2009 at 6:09 PM, Robert Dailey<br></div><div class="im">
<<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a> <mailto:<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a>>> wrote:<br>
> Thank you.<br>
> For future reference, is the glob syntax for CMake documented<br>
anywhere? If<br>
> it is, I have not been able to find it. Thanks again!<br>
><br>
> On Sat, Mar 28, 2009 at 4:51 PM, Carlson Daniel<br></div>
<<a href="mailto:daniel.c.carlson@gmail.com" target="_blank">daniel.c.carlson@gmail.com</a> <mailto:<a href="mailto:daniel.c.carlson@gmail.com" target="_blank">daniel.c.carlson@gmail.com</a>>><div class="im">
<br>
> wrote:<br>
>><br>
>> try:<br>
>><br>
>> *.(h|hpp|ipp)<br>
>><br>
>> 2009/3/28 Robert Dailey <<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a><br></div>
<mailto:<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a>>><div class="im"><br>
>>><br>
>>> Can I get some help with this? Sorry to rush, but I'm a bit<br>
blocked. I<br>
>>> know some of you may be tempted to ask my why I'm doing<br>
this and possibly<br>
>>> even try to change my mind, but with all do respect, I<br>
don't plan to avoid<br>
>>> globbing :)<br>
>>><br>
>>> On Fri, Mar 27, 2009 at 7:07 PM, Robert Dailey<br></div>
<<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a> <mailto:<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a>>><div class="im"><br>
>>> wrote:<br>
>>>><br>
>>>> I need to create a glob expression (For file( GLOB_RECURSE<br>
) ) that will<br>
>>>> find files with the following extensions:<br>
>>>> *.h<br>
>>>> *.hpp<br>
>>>> *.ipp<br>
>>>> How can I format my glob expression to do this? I know for<br>
HPP and IPP<br>
>>>> files, my glob expression would be:<br>
>>>> *.[hi]pp<br>
>>>> However, this ignores all H files.<br>
>>><br>
>>> _______________________________________________<br>
</div></blockquote>
</blockquote></div><br></div>