On 01/15/2013 03:51 PM, Brad King wrote:
> + cmake_policy(GET_WARNING CMP0020 warnMessage)
> + message(WARNING ${warnMessage})
>
> should use message(AUTHOR_WARNING). All policy warnings are for authors.
One problem with this approach is that it will produce warnings for
every project that has not set the policy when they find_package(Qt4).
This will be confusing and requires every project to be modified to
be made aware of the policy (or require 2.8.11) whether it uses the
imported targets or not.
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.
-Brad
--
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers