[CMake] File Globbing

Tristan Carel tristan.carel at gmail.com
Fri Oct 27 02:13:25 EDT 2006


On 10/26/06, Tristan Carel <tristan.carel at gmail.com> wrote:
> On 10/26/06, Matthew Campbell <Matthew.Campbell at emergent.net> wrote:
> >
> > [...]
>
> [...]
>
> I don't see how to make 'globbing' patterns which can:
> - find .h and .cpp
> - find files which do NOT contain a specific pattern.
> I'm interesting if you see a way to do it.
>
> ==> you have to duplicate entries for each set of files:
> FILE(GLOB Mac_CPP "*_Mac.cpp")
> FILE(GLOB Mac_H "*_Mac.h")
> LIST(APPEND Mac_Sources ${Mac_CPP} ${Mac_H})

The documentation've just told me that you can specify multiple
globbing expressions to the LIST(GLOB ...) command. So you can replace
the 3 previous lines by this:

FILE(GLOB Mac_Sources "*_Mac.cpp" "*_Mac.h")

-- 
Tristan Carel
http://tristan-carel.com
A timid person is frightened before a danger, a coward during the
time, and a courageous person afterward. (Jean Paul Richter)


More information about the CMake mailing list