[cmake-developers] Review Request: Automatically link to libqtmain on Windows
Brad King
brad.king at kitware.com
Wed Jan 16 13:04:35 EST 2013
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?
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".
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.
-Brad
More information about the cmake-developers
mailing list