[cmake-developers] INTERFACE IMPORTED example

Brad King brad.king at kitware.com
Thu Mar 22 07:37:44 EDT 2018

On 03/21/2018 06:01 PM, Craig Scott wrote:
> I swear I asked this a while back and there was an example given

Maybe here:

* https://gitlab.kitware.com/cmake/cmake/merge_requests/1581

> Does anyone know of a specific example scenario where an
> INTERFACE IMPORTED library is the right choice over simply
> INTERFACE or IMPORTED on its own?

A non-INTERFACE imported target needs an IMPORTED_LOCATION,
so an IMPORTED target wouldn't replace an INTERFACE IMPORTED

A plain INTERFACE library and an IMPORTED INTERFACE library are
nearly identical indeed, but the scope of the name differs.

IMPORTED INTERFACE libraries mostly exist for install(EXPORT)
to produce from an installed/exported INTERFACE library.
They can't export as a normal INTERFACE library because
imported targets have visibility isolated to the directory
that imports them.


More information about the cmake-developers mailing list