[cmake-developers] Safe source list GLOBs

Alexander Neundorf neundorf at kde.org
Wed May 15 13:26:58 EDT 2013


On Wednesday 15 May 2013, Bill Hoffman wrote:
> On 5/15/2013 4:48 AM, Wojciech Knapik wrote:
> > On Tue, May 14, 2013 at 03:55:37PM -0400, Bill Hoffman wrote:
> >> Globs simply do not work well for source files.
> > 
> > GLOBs work great for source files. Just not with CMake currently ;]
> 
> No it does not.   It is sloppy IMO.   It will pick up junk files.   It
> can create a whole host of unpredictable things to happy.   Let's say a
> file is accidentally deleted, or added to a directory, or gets packaged
> incorrectly.  It moves the error to link or compile time instead of
> configure time.   Removing a file from the build requires deleting the
> file from the disk instead of just removing it from a list.  Also, it
> requires the build system to query the whole directory tree before each
> build so it is slow by nature.
> 
> I don't see what the big deal is.   You run glob once from a shell or
> editor and you get the initial list of files.   From that point on the
> effort to add/remove a new file to the list is trivial.

I agree, this is really only an issue at all when creating the CMakeLists.txt 
initially.

Alex



More information about the cmake-developers mailing list