[cmake-developers] INTERFACE_LIBRARY target type

Brad King brad.king at kitware.com
Wed Apr 24 16:13:13 EDT 2013


On 04/24/2013 03:01 PM, Alexander Neundorf wrote:
> It is currently possible to do this by manually creating an imported target 
> and settings its properties. Not sure whether some features are missing then, 
> but if not, then for that purpose a new target type would not be required.
> (that's basically the same as using export(), but without the exporting).

Yes, except that one would manually have to set all the properties on a
per-platform basis where export() takes care of it automatically.  We'd
like to deprecate export()'s configure-time generation and in the future
delay it to generate time to allow major internal cleanups.

> Having said that, would IMPORTED targets actually be good enough for all the 
> things you list, maybe with some wrapper macros ?

The IMPORTED targets still need to have an IMPORTED_LOCATION that refers
to a real file, so they are not quite equivalent to the proposed INTERFACE
or ALIAS targets.  What they all share in common is the lack of build-time
actions.

The proposed INTERFACE and ALIAS target types would remain the same when
exported instead of being converted to IMPORTED targets.  However, all
their interface content would be mapped to the exported names.

I think new target types are worth considering for these roles to keep the
"IMPORTED" concept focused on importing targets with files on disk.

-Brad



More information about the cmake-developers mailing list