[CMake] File Globbing

Matthew Campbell Matthew.Campbell at emergent.net
Thu Oct 26 21:39:24 EDT 2006


Hey guys,

 

So to warn you, this is really more of a regular expression question than a
cmake question but since the problem is in a cmake script I thought you guys
may cut me some slack. :-)  In any case, I have a situation where my source
directory contains the following:

 

Something.cpp

SomethingElse.cpp

File_Win32.cpp

File_Linux.cpp

File_Mac.cpp

 

What I want to do is glob for all files not having an _Win32, or a _Linux,
etc. and then in the cmake script based on which OS I'm on, glob for the
appropriate OS specific files. I assuming CMake can support this just fine
since I believe FILE (GLOB []) takes a regular expression. Could someone tell
me what the regex. Is for this operation?

 

The results should be: PLATFORM_INDEPENDENT_SOURCES = Something.cpp
SomethingElse.cpp

                                 WIN32_SOURCES = File_Win32.cpp

 

The PLATFORM_INDEPENDENT_SOURCES is the part I am having troubles with
figuring out the regular expression for.

 

Thanks.

 

-Matt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20061026/70ff43aa/attachment.htm


More information about the CMake mailing list