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

Stephen Kelly steveire at gmail.com
Wed Jul 31 11:22:44 EDT 2013


Brad King wrote:

> On 07/31/2013 11:05 AM, Stephen Kelly wrote:
>> Config sensitive dirs are likely more common for libraries
>> than includes, so actually I think it would be fine to make that an error
>> and always do full evaluation.
> 
> To clarify, the no-config rule is for INCLUDES DESTINATION only, but full
> with-config evaluation will be allowed for a real DESTINATION.  The
> config can be honored for file destinations.  For targets we generate
> a per-config IMPORTED_LOCATION_<CONFIG> anyway.  We will wait for after
> 2.8.12 for the file destination generator expressions.

Right.

> 
>> I've pushed INCLUDES-DESTINATION-no-config to my clone with an
>> implementation. Can I merge it to next?
> 
> Yes, but one comment first:
> 
> +  if (cge->GetHadContextSensitiveCondition())
> +    {
> +    cmMakefile* mf = target->GetMakefile();
> +    cmOStringStream e;
> +    e << "Target \"" << target->GetName() << "\" is installed with "
> +    "INCLUDES DESTINATION set to a configuration sensitive path.  This is
> "
> 
> Does "context sensitive" condition ever mean something other than
> "configuration sensitive"?  If so then users may produce a case that
> triggers this error in a confusing manner.
 
Yes, is also means that TARGET_POLICY was used, or a 
LINK_INTERFACE_DEPENDENT_{BOOL,STRING} property was used in the generator 
expression.

In the case of the target policy, it makes sense to error on this because 
there is no point in changing the property based on the policy setting of 
the consumer of the IMPORTED target.

For LINK_INTERFACE_DEPENDENT_STRING properties it is a bit unfortunate, 
because we can't use the QT_MAJOR_VERSION target property and install to 
either include/Qt4Based or include/Qt5Based depending on which version we're 
installing for.

However, that is still easily possible with target_include_directories.

Thanks,

Steve.







More information about the cmake-developers mailing list