[CMake] CMP0005 warning as default

Bill Hoffman bill.hoffman at kitware.com
Thu Apr 30 08:10:52 EDT 2009


Dieter Oberkofler wrote:
> The warning offers a lot of information on how to disable but is it really
> intended to get the following warning by default?
> 
> ----------
> CMake Warning (dev) at cmake/Definitions.cmake:51 (ADD_DEFINITIONS):
>   Policy CMP0005 is not set: Preprocessor definition values are now escaped
>   automatically.  Run "cmake --help-policy CMP0005" for policy details.  Use
>   the cmake_policy command to set the policy and suppress this warning.
> Call Stack (most recent call first):
>   CMakeLists.txt:126 (INCLUDE)
> This warning is for project developers.  Use -Wno-dev to suppress it.
> ----------
> 
> If I understand the new policies correctly it should rather apply the policy
> by default and allow to set it to OLD for compatibility reasons.
> 

This means that some code in your project was affected by this policy. 
By default CMake is doing what it did in the past, plus giving you a 
warning that things have changed.  It is expected that you would set the 
policy to NEW and make sure your project works with it set to NEW.  This 
way we don't break existing projects, but we can still make changes that 
might required some modification to projects.

-Bill


More information about the CMake mailing list