[cmake-developers] Setting source property COMPILE_DEFINITIONS

Kornel Benko kornel at lyx.org
Mon Oct 15 16:29:57 EDT 2012


Am Montag, 15. Oktober 2012 um 15:51:39, schrieb David Cole <david.cole at kitware.com>
> Consider an alternate approach:
> 
> Write a header file named "xx.define.h" and include it ONLY in x.cpp.
> 
> #define XX "seomthing"
> 
> Then you don't even have to re-run CMake to change the definition of
> XX. Just edit the header file and re-compile.
> 
> Especially when you realize you've misspelled something.
> 
> 
> :-)
> 

Thanks, did something similar. Since the define-value is created dynamically
I used configure_file(...) to create the include.

	Kornel

> On Mon, Oct 15, 2012 at 3:47 PM, Kornel Benko <kornel at lyx.org> wrote:
> > Am Montag, 15. Oktober 2012 um 15:40:18, schrieb Brad King
> > <brad.king at kitware.com>
> >
> >> 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
> >
> >
> >
> > Thanks Brad. I nearly expected/feared something like this. Pity.
> >
> >
> >
> > Kornel
> >
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20121015/fee56107/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/fee56107/attachment.sig>


More information about the cmake-developers mailing list