[cmake-developers] [patch] Policy CMP0046 warning fix.

Nils Gladitz nilsgladitz at gmail.com
Fri Mar 28 16:15:03 EDT 2014


On 28.03.2014 20:08, Alexandru Ciobanu wrote:
> Hi,
>
> We were testing CMake3.0-rc3 and observed the following problem with policy CMP0046:
>     - even when policy is set to NEW behaviour, it warns about not setting policy (upon finding a missing dependency).
>
> It is currently warning:
>       Policy CMP0046 is not set: Error on non-existent dependency in
>       add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
>       Use the cmake_policy command to set the policy and suppress this warning.
>
>       The dependency target "missingtarget" of target "ctarget2" does not exist.
>
>
> When in fact it should just warn about the missing target:
>       The dependency target "missingtarget" of target "ctarget2" does not exist.
>
> I attach a minimal CMakeLists.txt file that illustrates the issue.
>
> I also attach a patch for review, which I believe solves the problem.
>

Thank you.

This is my fault. I'll set up a new topic and will merge a slightly 
modified version (the "specific" message is missing in the WARN case) of 
your patch.
I think I reused the pattern from another policy which is likely to be 
broken the same way.
I'll try finding and fixing  that as well.

Nils






More information about the cmake-developers mailing list