I would prefer it just work. For large directory hierarchies, running the glob twice is severely inefficient.<div><br></div><div>Thanks for the link to the documentation. Can anyone figure out a way to glob for H, HPP, and IPP files in a single glob operation? Is it even possible? I'd be really disappointed it it wasn't.<br>
<br><div class="gmail_quote">On Sat, Mar 28, 2009 at 11:14 PM, James Bigler <span dir="ltr"><<a href="mailto:jamesbigler@gmail.com">jamesbigler@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
The regular expression syntax is documented under the 'string' 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. "*.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>
<font color="#888888"><br>
James<br>
</font><div><div></div><div class="h5"><br>
On Sat, Mar 28, 2009 at 6:09 PM, Robert Dailey <<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>> wrote:<br>
> Thank you.<br>
> For future reference, is the glob syntax for CMake documented 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 <<a href="mailto:daniel.c.carlson@gmail.com">daniel.c.carlson@gmail.com</a>><br>
> wrote:<br>
>><br>
>> try:<br>
>><br>
>> *.(h|hpp|ipp)<br>
>><br>
>> 2009/3/28 Robert Dailey <<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>><br>
>>><br>
>>> Can I get some help with this? Sorry to rush, but I'm a bit blocked. I<br>
>>> know some of you may be tempted to ask my why I'm doing this and possibly<br>
>>> even try to change my mind, but with all do respect, I don't plan to avoid<br>
>>> globbing :)<br>
>>><br>
>>> On Fri, Mar 27, 2009 at 7:07 PM, Robert Dailey <<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>><br>
>>> wrote:<br>
>>>><br>
>>>> I need to create a glob expression (For file( GLOB_RECURSE ) ) 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 HPP and IPP<br>
>>>> files, my glob expression would be:<br>
>>>> *.[hi]pp<br>
>>>> However, this ignores all H files.<br>
>>><br>
>>> _______________________________________________<br>
>>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>><br>
>>> Visit other Kitware open-source projects at<br>
>>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>><br>
>>> Please keep messages on-topic and check the CMake FAQ at:<br>
>>> <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>>><br>
>>> Follow this link to subscribe/unsubscribe:<br>
>>> <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the CMake FAQ at:<br>
> <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>