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

Alexandru Ciobanu alex at rogue-research.com
Fri Mar 28 15:08:42 EDT 2014


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.

sincerely,
Alex Ciobanu

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140328/7eb837b7/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fixed-CMP0046-policy-warning-message-problem.patch
Type: application/octet-stream
Size: 2155 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140328/7eb837b7/attachment.obj>


More information about the cmake-developers mailing list