[cmake-developers] EXPORT_NAME-genex

Alexander Neundorf neundorf at kde.org
Wed May 22 14:53:01 EDT 2013


On Monday 20 May 2013, Stephen Kelly wrote:
> Alexander Neundorf wrote:
> >> > the value and cost.
> >> 
> >> value:
> >>  * We can assume that NS::foo is an imported target and error if not
> >>  found
> > 
> > Since it was never forbidden and not even officially recommended to use
> > "::" when exporting targets, I'm not sure the "::" should be used for the
> > decision whether an error is generated or not.
> 
> The proposal is to recommend it. The incentive is better error checking.

I don't oppose recommending to use "::" at all.
But basing the decision for erroring out or not on that doesn't sound good to 
me.

> > Also, the "::" is only a strong indication, not more.
> > E.g. I can build the attached example using the ninja generator.
> 
> Yes, I raised the same issue when I brought this up before:
> 
>  http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/6106/focu
> s=6695
> 
> > And as I said already before, I would not recommend using imported target
> > names directly.
> 
> In some cases, handling the imported target can not be avoided, as
> Friedrich just discovered:
> 
>  http://thread.gmane.org/gmane.comp.kde.devel.core/79205
> 
> So, I don't think we should pretent they don't exist, or try to hide the
> fact that they exist.

How is this related to using the target names directly ?

Beside that, it still leaves the issue that the only existing "standard" for 
find_package() is the names of the variables:

find_package(Foo)

include_libraries(${Foo_INCLUDE_DIRS})
...
target_link_libraries(hello ${Foo_LIBRARIES})

Following that would be a benefit for cmake users.

What do you suggest as standard naming for the imported targets ?
Maybe Foo::Library ?

Still, then we would have two competing standards, that's not better than 1 
standard.

Alex



More information about the cmake-developers mailing list