[cmake-developers] Setting source property COMPILE_DEFINITIONS

Kornel Benko kornel at lyx.org
Mon Oct 15 15:26:34 EDT 2012


Hi,
I see a problem in setting the source property for a certain file, say x.cpp.

	set_property(SOURCE x.cpp APPEND COMPILE_DEFINITIONS XX="something")

At first glance, this seems to work well, in that only x.cpp gets compiled with '-DXX="something"'.
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.

	Kornel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20121015/e07e4dc8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20121015/e07e4dc8/attachment.sig>


More information about the cmake-developers mailing list