[cmake-developers] Setting source property COMPILE_DEFINITIONS

Brad King brad.king at kitware.com
Mon Oct 15 15:40:18 EDT 2012


On 10/15/2012 03:26 PM, Kornel Benko wrote:
> Unfortunately, if "something" changes, the effect is, that _all_ sources in the relevant
> directory are recompiled. (I expected the recompilation of x.cpp only).
> 
> This may depend on the build system. In my case "Unix makefiles". The reason is
> 
> that each object file created for this directory depends on "flags.make", which changes accordingly.
> 
> If one has hundreds of files in the source dir, this is less welcome.

This is a known limitation of the Makefile generator.  We cannot use
a per-object flags.make file because some filesystems are EXTREMELY
slow at using lots of tiny files.  There may be an issue tracker
entry asking for this to be solved, but I don't think it ever will
be.

-Brad



More information about the cmake-developers mailing list