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

Brad King brad.king at kitware.com
Mon Oct 19 09:39:15 EDT 2015


On 10/18/2015 07:59 AM, Michael Scott wrote:
> I was thinking of coming back to issue of the deprecation and author 
> message options, now that CMake 3.4 has been released, is now a suitable 
> time for it?

Yes.  Early in the development cycle is best.

> We modify cmake::IssueMessage to check the relevant CMake variables to 
> determine if the message should be output and at which level, we try to 
> get the script provided values if possible but handle the case where we 
> can't.

cmake::IssueMessage does not have access to variables because it has no
specific scope.  It can only pay attention to global (cached) settings.
I think having local CMAKE_WARN_DEPRECATED/CMAKE_ERROR_DEPRECATED vars
can be left as specific to the message() command (and perhaps other
IssueMessage callers as deemed appropriate per-case).  Otherwise we
should just have one global setting.

> We also modify IssueMessage to use 
> cmSystemTools::SetFatalErrorOccured (or SetErrorOccured if that's 
> preferred) if a warning has been turned into an error. Finally we modify 
> the users of IssueMessage, to check the error occured state using 
> cmSystemTools, and use that to determine if an error has occured (rather 
> than the message level going into IssueMessage) and if the return value 
> should be changed accordingly.

I realized we don't actually have to make warning=>error conversion
immediately stop processing.  We just need to make sure the process
exit code is changed.  We may not have to update all callers to
achieve this; it would only be an optimization.  OTOH perhaps we
should defer this part until after the main warning control
command-line options are worked out.

Thanks,
-Brad



More information about the cmake-developers mailing list