[cmake-developers] Setting includes, defines and other usage requirements with one command

Alexander Neundorf neundorf at kde.org
Tue Jan 29 15:33:06 EST 2013


On Saturday 26 January 2013, Stephen Kelly wrote:
> Brad King wrote:
> > I've longed for "usage requirements" for years and always pictured
> > them propagating through linking.  The huge threads of discussion
> > earlier made usage requirements seem more complicated than they are
> > and made it feel like we should hide it all behind new interfaces.
> > Now I think a new command will actually be *more* confusing in the
> > long run because the two will be different only in subtle ways and
> > users will wonder which one to use.
> 
> Yes, that's exactly my thinking too.
> 
> > I'm almost ready to accept the proposed behavior for
> > target_link_libraries.  However, we still need to construct a
> > recommended way for packages and their dependents to handle the
> > transition.  There are many, many instances of the old style usage
> > since it is the only one that previously worked.
> > 
> > How can a package author allow old dependents using the old style to
> > keep working while also allowing new dependents using the new style
> > to work?
> 
> As compile definitions are uniq'd, they don't pose any backward
> compatibility concerns for downstreams of a project whose upstream adds
> them.
> 
> In the worst case, the needed compile definitions will be duplicated by an
> existing call to add_definitions(), and in the best case the needed
> defintions will be added where they were absent before.

No, adding definitions which where not there before (but the project was 
building and working nevertheless) can potentially break builds.
Not likely, but possible.

Alex



More information about the cmake-developers mailing list