[CMake] Removing files from a globbed list

Alexander Neundorf a.neundorf-work at gmx.net
Mon Jun 22 17:58:26 EDT 2009


On Monday 22 June 2009, James C. Sutherland wrote:
> I am trying to add most files from a directory to a variable.  I first
> glob the source files, and then want to remove the unwanted files from
> the resulting string.  

Really, don't do that.
Just add all files you want to compile explicitely to the CMakeLists.txt.
If you glob, you
- may get files you did not want
- have to run cmake manually to update the list of files, instead of leaving 
this to the dependency handling, otherwise
- you don't get the files you want

Alex


More information about the CMake mailing list