[cmake-developers] Safe source list GLOBs

Bill Hoffman bill.hoffman at kitware.com
Wed May 15 09:50:34 EDT 2013


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.
>
....
>
> Agreed. The problem remains though.
I don't see it as a problem that can or even should be fixed.

-Bill



More information about the cmake-developers mailing list