[cmake-developers] Setting include directories via target_link_libraries() ?

Alexander Neundorf neundorf at kde.org
Tue Dec 18 11:33:37 EST 2012


On Tuesday 18 December 2012, Stephen Kelly wrote:
> Alexander Neundorf wrote:
> > This would have the same effect, but people could simply hide the
> > USE_INTERFACES keyword in a variable:
> > set(Foo_LIBRARIES USE_INTERFACES Foo::FooLib)
> > 
> > and then it's again hidden:
> > target_link_libraries(hello ${JPEG_LIBRARIES} ${Foo_LIBRARIES})
> 
> I don't see why anyone would do that. 

A buildsystem maintainer might decide that he simply wants to provide the 
normal Foo_LIBRARIES variable to its users, so they can simply continue to use 
it as they always did, and don't have to care about the new cmake features.
I don't say whether that's a good or bad idea, but it's possible and IMO not 
too far fetched.

Alex



More information about the cmake-developers mailing list