[cmake-developers] Add command line options for deprecation message control

Brad King brad.king at kitware.com
Mon Jul 6 15:24:17 EDT 2015


On 07/02/2015 04:45 PM, Michael Scott wrote:
> On 06/30/2015 05:42 PM, Stephen Kelly wrote:
>> What is the difference between the intended uses of those existing options
>> and the intended uses of the new options, given that -Wno-dev is mostly
>> useful for third parties to silence policy warnings?
> 
> Working on this issue, I did find the different variables/options a bit
> confusing. dev and deprecated both change the effect of message modes,
> pretty much doing the same thing but slightly different

For reference, the -Wdev/-Wno-dev options were added originally to control
the cmake::AUTHOR_WARNING message type introduced for cmake policy warnings.
Later message(AUTHOR_WARNING) was added to expose it to the CMake language.
Then message(DEPRECATION) was added as completely separate functionality
without considering its overlap with AUTHOR_WARNING.

This thread is a good chance to resolve or distinguish the overlapping
warning types more clearly, perhaps with documentation updates.  The
AUTHOR_WARNING and DEPRECATION_WARNING are not necessarily the same.
The former is a superset of the latter.  CMake language code may want to
warn about doing something wrong that is not deprecated behavior.  Both
types are of interest to project authors but not necessarily users.

> (for example there is -Wdev and -Wno-dev, but not -Werror=dev or -Wno-error=dev).

The need for the latter recently came up here:

 A policy for Policies
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/13376/focus=13476
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/13376/focus=13512

In that discussion we decided to start making some policy OLD behavior
produce deprecation warnings, and also that we need a way to help users
find them (e.g. by optionally making them errors).

> Would it be worth refactoring the -W dev options to be in line with the -W
> deprecated options?
> 
>> If the new options are merged to master should -Wdev and -Wno-dev also be
>> changed to affect CMAKE_WARN_DEPRECATED?
> 
> That would be sensible behaviour to me, shall I modify cmake::Configure to
> do this?

Since AUTHOR_WARNING is a superset of DEPRECATION_WARNING I think
-W[no-]dev can influence CMAKE_WARN_DEPRECATED.  Please also add
-W[no-]error=dev to turn AUTHOR_WARNING into an error and also make
it influence CMAKE_ERROR_DEPRECATED.  Then -Wdeprecated and friends
can still be used to control the DEPRECATION messages separately.

Thanks,
-Brad


More information about the cmake-developers mailing list