[CMake] Feature Request: FILE (GLOB files "*.c" EXCEPT main.c test.c)

Alexander Neundorf a.neundorf-work at gmx.net
Tue Aug 14 08:23:29 EDT 2007


On Tuesday 14 August 2007 07:48, Martin Lutken wrote:
> It seems to me that many existing SW libraries, which it would be nice to
> have converted to cmake, cannot too easily make use of the fileglobbing
> since quite often, there are a few files which you don't want to compile in
> order to produce the library.
>
> So a syntax like :
> FILE (GLOB files "*.c" EXCEPT main.c test.c)
> or
> FILE (GLOB files "*.c" EXCLUDE main.c test.c)
>
> I think would make it a lot easier to port and maintain cmake files for
> existing libraries.

You shouldn't do this to get the list of source files.
If you list the files in the cmake file, then cmake will notice if a file has 
been added or removed and rerun.
If you are using GLOB, the cmake files are not modified and so cmake doesn't 
rerun if some file has been added or removed, this is especially inconvenient 
if you update your sources from a version control system where you don't 
know/care whether some file somewhere has been added or removed.

Bye
Alex


More information about the CMake mailing list