[cmake-developers] Setting target properties before the target is defined ?

Stephen Kelly steveire at gmail.com
Wed Apr 24 07:14:25 EDT 2013


Brad King <brad.king at ...> writes:

> 
> Steve,
> 
> I think this may fall under your expertise now.  The goal is to generate
> a nice error message when an imported target's link interface depends on
> other targets that should have been imported but have not been.  Currently
> we just get a build-time link failure because the name is treated as a
> plain library name.  We'd like a generate-time error message with as much
> context as possible instead.

I was thinking about this issue recently.

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/6106

It's becoming conventional to use a namespace like NS:: for imported
targets. Would it be possible to assume that if linking to something which
has double colons, then it must be an imported target, and if we can't find
such an imported target, to report an error at generate time? That would
also be an incentive to use the convention of using :: in imported targets,
and we could document it as recommended.

For makefile generators and xcode it is not possible to use create
non-imported targets in a buildsystem. On Windows it doesn't seem to be
possible either (the : is mistaken for a drive delimiter). It does currently
work with Ninja though, so a policy may be needed if it's a workable solution.

Thanks,

Steve.





More information about the cmake-developers mailing list