[cmake-developers] Review Request: Automatically link to libqtmain on Windows

Stephen Kelly steveire at gmail.com
Wed Jan 16 12:15:34 EST 2013


Brad King wrote:
> I think we need C++-side help for this.  The policy setting should
> be recorded when the target to be linked is created.  That recorded
> setting should be used when evaluating the link interface.  Perhaps
> we need a generator expression like
> 
>  $<TARGET_POLICY:CMP0020>
> 
> which evaluates to 1 if the policy is set to NEW when the target was
> created and 0 otherwise.  If the policy is not set then the C++ code
> evaluating this expression can generate the policy warning.  Only
> specific policies that get recorded at target creation are allowed.
> Others generate an error.
> 

Good point. I've updated the topic on my gitorious clone, and tested that it 
works on Windows. (It required a small fix to a previous topic too).

I wonder if I should/can make this policy 'Qt' specific rather than 'Qt4' 
specific. 

That would allow me to use the same generator expression in the Qt 5 
implementation of this patch, and allow for 'policy behaviour compatibility' 
across the Qt versions. Creating a policy that can be interpreted as 
technically referring to code outside of the cmake repo is also something 
that has probably not been done before. I'd only be checking it in the same 
way from the Qt 5 config file anyway.

Thanks,

Steve.





More information about the cmake-developers mailing list