[cmake-developers] exports and MAP_IMPORTED_CONFIG_<CONFIG>

Stephen Kelly steveire at gmail.com
Thu Dec 13 11:22:15 EST 2012


Brad King wrote:

> On 12/13/2012 11:02 AM, Stephen Kelly wrote:
>> Brad King wrote:
>>> The mapping comes from the MAP_IMPORTED_CONFIG_ on the target from which
>>> the property value containing the current generator expression was read.
>> 
>> That's what I thought, but that property is not currently exported,
>> right?
> 
> It is set by the consuming project directly on the imported targets.
> In cmTarget::ComputeImportInfo we select for each consuming project
> configuration a configuration from the exporting project, either
> through the explicit MAP_ property or by heuristics.  Either way
> the selected mapping must be used as the configuration whenever we
> evaluate an expression that came from the target.

Ok, I think I get it, but I'll have to look into that code again.

>>  include(FooTargets.cmake)
>>  set_property(TARGET Foo::foo
>>     PROPERTY MAP_IMPORTED_CONFIG_COVERAGE Release
>>  )
> 
> Yes, this one.

That snippet was described to be from a config file - ie from the producing 
project.

However, I think the above is clear enough. The consuming project would set 
the property after a find_package.

Thanks,

Steve.





More information about the cmake-developers mailing list