[cmake-developers] Linked library paths

Brad King brad.king at kitware.com
Fri Jul 31 10:48:18 EDT 2015


On 07/30/2015 11:59 AM, Aleix Pol wrote:
> I need to get the linked libraries of a target. I was moving the code
> away from get_target_property to generator expressions that should get
> into a generated file, although I haven't managed yet.
> 
> Is there any possibility to do that already?
> 
> I've been thinking of adding something like a map function, so we can
> turn the target name we get from INTERFACE_LINK_LIBRARIES into a path,
> using the LOCATION property. Would that make sense?

It is not possible to get this information during the configuration
phase.  The LOCATION property is not allowed since CMP0026 for
a project's own targets.

> Otherwise, is it possible to properly get a function called right
> before cmake generation?

No CMake language code can be executed during generation.  That is
the domain of generator expressions.  It may be possible to add a
genex to provide the needed info (e.g. through file(GENERATE)).

What is your use case?

-Brad



More information about the cmake-developers mailing list