[CMake] Executable depending on all source files

Alexander Neundorf a.neundorf-work at gmx.net
Sat Aug 25 05:41:46 EDT 2012


On Saturday 25 August 2012, Russell Wallace wrote:
> How do you specify that an executable depends on all source files in a
> directory? I've tried doing it like:
> 
> add_executable(foo src/*.cc)
> 
> but that only seems to pick up the first source file?


Explicitely list all of them.
Globbing is not good, cmake can't notice then when it has to rerun, and it may 
pick up stuff it shouldn't.

Alex


More information about the CMake mailing list