[cmake-developers] Review Request: Automatically link to libqtmain on Windows
Stephen Kelly
steveire at gmail.com
Wed Jan 16 16:51:44 EST 2013
Brad King wrote:
> On 01/16/2013 12:15 PM, Stephen Kelly wrote:
>> 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).
>
> Thanks. In this expression:
>
> +
> $<$<AND:${_isExe},${_isWin32},${_isPolicyNEW},
${_isNotExcluded}>:Qt4::qtmain>
>
> the AND will short-circuit and skip the policy if it is not needed, right?
The policy will not be checked for non WIN32_EXECUTABLES, but for those
targets it will be checked.
As it was, it is also checked even if QT4_NO_LINK_QTMAIN is set, which I
have now changed.
>
> In the docs of the new property:
>
> + " $<TARGET_POLICY:pol> = '1' if the policy was NEW when " \
> + "the 'head' target was created, else '0'. If the policy was WARN, " \
> + "the warning message for the policy will be emitted. This generator " \
> + "expression only works for a subset of policies.\n" \
>
> we can't say "WARN" here. That is an internal implementation detail. In
> documentation it means "policy is not set".
Fixed now.
>
> Also please add a test for the new expression and its error cases.
>
>> 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.
>
> Since the policy is being added for something inside CMake and the
> $<TARGET_POLICY> generator expression is general-purpose I see no
> reason not to use it in outside code for the same purpose. Just
> make sure the documentation and warning messages are worded such
> that someone encountering them with Qt5 will not be confused.
Ok, 'ambiguated' now.
Thanks,
Steve.
More information about the cmake-developers
mailing list