No subject


Mon Dec 15 09:51:36 EST 2008


file(GLOB_RECURSE sources "*.{h,cpp}")

James

On Sun, Mar 29, 2009 at 2:21 AM, Carlson Daniel
<daniel.c.carlson at gmail.com> wrote:
> Ok, I thought that Cmake supported the standard regular expression used b=
y
> most GNU projects. The |-sign is an or-operator so the standard regular
> expression for this would be:
>
> ^.*\.(h|hpp|ipp)$
>
> but now I realize that global expression and regular expression is not th=
e
> same thing... Sorry for that!
>
> 2009/3/29 Robert Dailey <rcdailey at gmail.com>
>>
>> I would prefer it just work. For large directory hierarchies, running th=
e
>> glob twice is severely inefficient.
>> 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.
>>
>> On Sat, Mar 28, 2009 at 11:14 PM, James Bigler <jamesbigler at gmail.com>
>> wrote:
>>>
>>> The regular expression syntax is documented under the 'string' command
>>> in the help files. =A0There's also a wiki entry:
>>>
>>> http://vtk.org/Wiki/CMake_FAQ#Which_regular_expressions_are_supported_b=
y_CMake.3F
>>>
>>> I couldn't get file(GLOB_RECURSE sources "*.(h|cpp)") to work. =A0"*.h"
>>> would catch all the h files, "*.cpp" would catch all the cpp files,
>>> but the expression above didn't catch both.
>>>
>>> Robert, if the regular expression doesn't work for you, you could
>>> always just run the command twice and concatenate the results:
>>> file(GLOB_RECURSE h_files "*.h")
>>> file(GLOB_RECURSE hpp_ipp_files "*.[hi]pp")
>>> set(files "${h_files}" "${hpp_ipp_files}")
>>>
>>> James
>>>
>>> On Sat, Mar 28, 2009 at 6:09 PM, Robert Dailey <rcdailey at gmail.com>
>>> wrote:
>>> > Thank you.
>>> > For future reference, is the glob syntax for CMake documented anywher=
e?
>>> > If
>>> > it is, I have not been able to find it. Thanks again!
>>> >
>>> > On Sat, Mar 28, 2009 at 4:51 PM, Carlson Daniel
>>> > <daniel.c.carlson at gmail.com>
>>> > wrote:
>>> >>
>>> >> try:
>>> >>
>>> >> *.(h|hpp|ipp)
>>> >>
>>> >> 2009/3/28 Robert Dailey <rcdailey at gmail.com>
>>> >>>
>>> >>> Can I get some help with this? Sorry to rush, but I'm a bit blocked=
.
>>> >>> I
>>> >>> know some of you may be tempted to ask my why I'm doing this and
>>> >>> possibly
>>> >>> even try to change my mind, but with all do respect, I don't plan t=
o
>>> >>> avoid
>>> >>> globbing :)
>>> >>>
>>> >>> On Fri, Mar 27, 2009 at 7:07 PM, Robert Dailey <rcdailey at gmail.com>
>>> >>> wrote:
>>> >>>>
>>> >>>> I need to create a glob expression (For file( GLOB_RECURSE ) ) tha=
t
>>> >>>> will
>>> >>>> find files with the following extensions:
>>> >>>> *.h
>>> >>>> *.hpp
>>> >>>> *.ipp
>>> >>>> How can I format my glob expression to do this? I know for HPP and
>>> >>>> IPP
>>> >>>> files, my glob expression would be:
>>> >>>> *.[hi]pp
>>> >>>> However, this ignores all H files.
>>> >>>
>>> >>> _______________________________________________
>>> >>> Powered by www.kitware.com
>>> >>>
>>> >>> Visit other Kitware open-source projects at
>>> >>> http://www.kitware.com/opensource/opensource.html
>>> >>>
>>> >>> Please keep messages on-topic and check the CMake FAQ at:
>>> >>> http://www.cmake.org/Wiki/CMake_FAQ
>>> >>>
>>> >>> Follow this link to subscribe/unsubscribe:
>>> >>> http://www.cmake.org/mailman/listinfo/cmake
>>> >>
>>> >
>>> >
>>> > _______________________________________________
>>> > Powered by www.kitware.com
>>> >
>>> > Visit other Kitware open-source projects at
>>> > http://www.kitware.com/opensource/opensource.html
>>> >
>>> > Please keep messages on-topic and check the CMake FAQ at:
>>> > http://www.cmake.org/Wiki/CMake_FAQ
>>> >
>>> > Follow this link to subscribe/unsubscribe:
>>> > http://www.cmake.org/mailman/listinfo/cmake
>>> >
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.cmake.org/mailman/listinfo/cmake
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>
>


More information about the CMake mailing list