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&#39;d be really disappointed it it wasn&#39;t.<br>
<br><div class="gmail_quote">On Sat, Mar 28, 2009 at 11:14 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;">
The regular expression syntax is documented under the &#39;string&#39; 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.  &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>
<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 &lt;<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>&gt; wrote:<br>
&gt; Thank you.<br>
&gt; For future reference, is the glob syntax for CMake documented 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 &lt;<a href="mailto:daniel.c.carlson@gmail.com">daniel.c.carlson@gmail.com</a>&gt;<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">rcdailey@gmail.com</a>&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Can I get some help with this? Sorry to rush, but I&#39;m a bit blocked. I<br>
&gt;&gt;&gt; know some of you may be tempted to ask my why I&#39;m doing this and possibly<br>
&gt;&gt;&gt; even try to change my mind, but with all do respect, I 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 &lt;<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>&gt;<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 ) ) 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 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>
&gt;&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt;&gt;&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt;&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
&gt;<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>