[cmake-developers] [CMake 0014317]: Configuration dependent install EXPORT

Stephen Kelly steveire at gmail.com
Wed Jul 31 09:25:37 EDT 2013


Brad King wrote:

>> I've pushed a INCLUDES-DESTINATION-partial-eval topic to my clone with
>> some ideas for it. Please let me know what you think.
> 
> Are you proposing this for inclusion in 2.8.12?

Yes.

> IMO it can wait along with the rest.

As INCLUDES DESTINATION is already in master, that would be a behavior 
change, and probably need a policy. Currently if you use 

 install(TARGETS foo EXPORT fooTargets 
   INCLUDES DESTINATION $<INSTALL_PREFIX>/include/$<STREQUAL:foo,bar>
 )

the result in fooTargets.cmake is 

 INTERFACE_INCLUDE_DIRECTORIES
   "${_IMPORT_PREFIX}/include/$<STREQUAL:foo,bar>"

if the genex is evaluated at export time in a follow-up release, the result 
would instead be

 INTERFACE_INCLUDE_DIRECTORIES
   "${_IMPORT_PREFIX}/include/0"
 

So, I think for the case of INCLUDES DESTINATION, we can either decide and 
fix it now, or revert the change adding it for 2.8.12.

> 
> I forgot, which config-related generator expressions on imported
> targets honor MAP_IMPORTED_CONFIG_<CONFIG>?

The $<CONFIG:cfg> expression should always process those, if used on any of 
the target properties used for the interface.

> 
> What is the behavior when a not-allowed expression like
> STREQUAL is used?  Does it produce an error message?

In master the STREQUAL is reproduced verbatim. In my topic it is evaluated 
at export time. 

Thanks,

Steve.





More information about the cmake-developers mailing list