[CMake] Why SET() not support regular expression ?

David Cole david.cole at kitware.com
Fri Jan 18 07:58:10 EST 2008


If you do a FILE(GLOB cmake will not detect when files are added to the
directory and will *not* re-run automatically. If you explicitly list your
files in CMakeLists.txt, then when it changes, cmake re-runs automatically
as part of a build.

Don't use the FILE(GLOB technique unless you are willing to live with this
fact...

HTH,
David


On 1/18/08, Stuart Herring <cmake at stuartherring.com> wrote:
>
> On Jan 18, 2008 11:43 PM, Yang, Y. <Y.Yang at tue.nl> wrote:
>
> > For example, SET( MY_SRCS mydir/*.c)
> >
> > if CMake can do this, I don't have to modify the CMakeLists.txt every
> > time when I add new files to mydir.
> >
> > That's not exactly a regular expression - it's a glob.
> In any case, FILE(GLOB ...) is what you want. (as seen at
> http://www.cmake.org/HTML/Documentation.html)
> In this case FILE(GLOB MY_SRCS mydir/*.c)
>
> Although, personally I prefer to explicitly add files, that way I know I
> haven't inadvertently included something I didn't want.
>
> Regards,
> Stuart.
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20080118/87636a8f/attachment.htm


More information about the CMake mailing list