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

2016-01-20 Thread Stephen Kelly
Michael Scott wrote:

> If there are any problems with the proposed changes let me know.

Hi Michael,

Thanks for working on this topic over such a long time period to get it 
right.

I closed 

 http://public.kitware.com/Bug/view.php?id=15677

and 

 http://public.kitware.com/Bug/view.php?id=14669

on your behalf because I couldn't assign the bugs to you in mantis.

Thanks,

Steve.



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2016-01-12 Thread Michael Scott

Most of that change appears to be just the number of spaces after a
period.  I prefer two which is why the original message was that way.
Ah fair enough, I assumed the two spaces was a typo and was meant to be 
just one space.  Yes essentially the third patch just replaces the two 
spaces with one, so it can be just ignored in this case.



IIRC we previously concluded that the individual callers don't have to
deal with the message type change so long as the overall process exits
with an error.  Is this currently achieved by the patch?
Yes that will now happen with the patch, the cmake::displayMessage 
method will set the error occurred flag, though not the fatal flag, when 
a deprecation or author error message is displayed. In this case I think 
there are no issues I'm aware of with the proposed changes.


If there are any problems with the proposed changes let me know.

Cheers,
Michael

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2016-01-12 Thread Brad King
On 01/04/2016 06:52 PM, Michael Scott wrote:
> To round off the -W options functionality, I've implemented the -Werror 
> and -Wno-error set of options for the two current types of messages, dev 
> and deprecated. This includes updating the QT GUI to include new options 
> for controlling this functionality.

Thanks.  I'd first like to resolve the discussion below because it may
affect the first patch.

> The third patch is not for new functionality, but addresses two small 
> inconsistencies relating to dev and deprecated messages functionality, 
> it's not needed at the end of the day but I thought it would be good to 
> make the code consistent while I was in the area.

Most of that change appears to be just the number of spaces after a
period.  I prefer two which is why the original message was that way.

> Lastly I'm also looking at changing all the current usages of the 
> cmake::IssueMessage command, where the message type is dev warning. To 
> check if the warning got upgraded to an error (by checking if the error 
> state has been signalled with the cmSystemTools class), and change the 
> return value of the calling function for example. I think this was 
> discussed previously, however I think this might not be the right change 
> to make. There's quite a few instances of the above code and changing 
> them all is dangerous I imagine where I don't know exactly what all of 
> the callers are generally doing and should be doing. It also implies an 
> undocumented rule that future users of the above functionality should 
> also do this check, which doesn't sound like a good idea to me.  What 
> are your thoughts on this last point?

IIRC we previously concluded that the individual callers don't have to
deal with the message type change so long as the overall process exits
with an error.  Is this currently achieved by the patch?

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2016-01-04 Thread Michael Scott

Hi Brad,

To round off the -W options functionality, I've implemented the -Werror 
and -Wno-error set of options for the two current types of messages, dev 
and deprecated. This includes updating the QT GUI to include new options 
for controlling this functionality.


The third patch is not for new functionality, but addresses two small 
inconsistencies relating to dev and deprecated messages functionality, 
it's not needed at the end of the day but I thought it would be good to 
make the code consistent while I was in the area.


Lastly I'm also looking at changing all the current usages of the 
cmake::IssueMessage command, where the message type is dev warning. To 
check if the warning got upgraded to an error (by checking if the error 
state has been signalled with the cmSystemTools class), and change the 
return value of the calling function for example. I think this was 
discussed previously, however I think this might not be the right change 
to make. There's quite a few instances of the above code and changing 
them all is dangerous I imagine where I don't know exactly what all of 
the callers are generally doing and should be doing. It also implies an 
undocumented rule that future users of the above functionality should 
also do this check, which doesn't sound like a good idea to me.  What 
are your thoughts on this last point?


Cheers,
Michael
>From 319afb022cae89d64bc9075e2a686966971cda1c Mon Sep 17 00:00:00 2001
From: Michael Scott 
Date: Mon, 21 Dec 2015 21:39:27 +
Subject: [PATCH 1/3] Implement -Werror and -Wno-error cmake options

Expanded the -W set of cmake options to include support for the -Werror
and -Wno-error format, which is used to control upgrading and downgrading
warning and error messages. Implemented support for these new formats for
the dev and deprecated message types.

Added tests and updated documentation for new options.
---
 Help/manual/OPTIONS_BUILD.txt  |  24 +++
 Help/release/dev/cmake-W-options.rst   |   7 +
 Source/cmMessageCommand.cxx|  29 +--
 Source/cmake.cxx   | 200 -
 Source/cmake.h |  42 -
 Tests/RunCMake/CommandLine/RunCMakeTest.cmake  |  22 +++
 Tests/RunCMake/CommandLine/W_bad-arg3-result.txt   |   1 +
 Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt   |   2 +
 .../CommandLine/Werror_deprecated-result.txt   |   1 +
 .../CommandLine/Werror_deprecated-stderr.txt   |   4 +
 Tests/RunCMake/CommandLine/Werror_deprecated.cmake |   1 +
 Tests/RunCMake/CommandLine/Werror_dev-result.txt   |   1 +
 Tests/RunCMake/CommandLine/Werror_dev-stderr.txt   |  11 ++
 Tests/RunCMake/CommandLine/Werror_dev.cmake|   7 +
 .../CommandLine/Wno-error_deprecated-stderr.txt|   4 +
 .../CommandLine/Wno-error_deprecated.cmake |   2 +
 .../RunCMake/CommandLine/Wno-error_dev-stderr.txt  |  11 ++
 Tests/RunCMake/CommandLine/Wno-error_dev.cmake |   7 +
 Tests/RunCMake/message/RunCMakeTest.cmake  |   6 +-
 Tests/RunCMake/message/errormessage-result.txt |   1 -
 Tests/RunCMake/message/errormessage-stderr.txt |   4 -
 Tests/RunCMake/message/errormessage.cmake  |   4 -
 .../message/errormessage_deprecated-result.txt |   1 +
 .../message/errormessage_deprecated-stderr.txt |   4 +
 .../RunCMake/message/errormessage_deprecated.cmake |   3 +
 Tests/RunCMake/message/errormessage_dev-result.txt |   1 +
 Tests/RunCMake/message/errormessage_dev-stderr.txt |   5 +
 Tests/RunCMake/message/errormessage_dev.cmake  |   3 +
 28 files changed, 372 insertions(+), 36 deletions(-)
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg3-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Werror_deprecated-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Werror_deprecated.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Werror_dev-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/Werror_dev-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Werror_dev.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Wno-error_deprecated-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Wno-error_deprecated.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Wno-error_dev-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Wno-error_dev.cmake
 delete mode 100644 Tests/RunCMake/message/errormessage-result.txt
 delete mode 100644 Tests/RunCMake/message/errormessage-stderr.txt
 delete mode 100644 Tests/RunCMake/message/errormessage.cmake
 create mode 100644 Tests/RunCMake/message/errormessage_deprecated-result.txt
 create mode 100644 Tests/RunCMake/message/errormessage_deprecated-stderr.txt
 create mode 100644 Tests/RunCMake/message/errormessage_deprecated.cmake
 create mode 100644 

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

2015-12-09 Thread Brad King
On 12/07/2015 01:51 PM, Michael Scott wrote:
>> I noticed one glitch.  I built against Qt 5.5.1 on Linux and the
>> option dialog seems to truncate the labels.
> I think I've fixed it, by using vertical layouts rather than form 
> layouts and setting the size policy to expanding for the widgets, if 
> that doesn't fix I'll need to look into QT in more depth as I've not got 
> much experience with it. Which Linux distro did you notice it in, looks 
> like gnome3?

It is Debian 'testing' with KDE 5.  Your changes fixed it for me.

> Patches for the fix are attached.

Thanks.  Applied with slightly modified commit messages and
merged to 'next' for testing:

 cmake-gui: Add options to control warning messages
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1850455

 cmake: Deduplicate warning message control code
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f4a91ef

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-12-07 Thread Michael Scott

I noticed one glitch.  I built against Qt 5.5.1 on Linux and the
option dialog seems to truncate the labels.
I think I've fixed it, by using vertical layouts rather than form 
layouts and setting the size policy to expanding for the widgets, if 
that doesn't fix I'll need to look into QT in more depth as I've not got 
much experience with it. Which Linux distro did you notice it in, looks 
like gnome3?


Patches for the fix are attached.

Cheers,
Michael
>From 320d791eb6f97e590716c555da0345de31e65cfc Mon Sep 17 00:00:00 2001
From: Michael Scott 
Date: Sun, 6 Dec 2015 12:33:13 +
Subject: [PATCH 1/2] Warning messages options in cmake-gui

Created a new dialog window for the cmake-gui, which provides
controls for setting the state of suppression of developer and
deprecated warning messages. This replaces the previous single
checkbox for setting the state of suppression of developer warnings.

Added a note for the new functionality to the release notes.
---
 Help/release/dev/cmake-W-options.rst  |   3 +
 Source/QtDialog/CMakeLists.txt|   4 +
 Source/QtDialog/CMakeSetupDialog.cxx  |  15 ++--
 Source/QtDialog/CMakeSetupDialog.h|   3 +-
 Source/QtDialog/QCMake.cxx|  18 -
 Source/QtDialog/QCMake.h  |   7 +-
 Source/QtDialog/WarningMessagesDialog.cxx |  43 +++
 Source/QtDialog/WarningMessagesDialog.h   |  53 +
 Source/QtDialog/WarningMessagesDialog.ui  | 120 ++
 Source/cmake.cxx  |  33 +++-
 Source/cmake.h|   7 ++
 11 files changed, 292 insertions(+), 14 deletions(-)
 create mode 100644 Source/QtDialog/WarningMessagesDialog.cxx
 create mode 100644 Source/QtDialog/WarningMessagesDialog.h
 create mode 100644 Source/QtDialog/WarningMessagesDialog.ui

diff --git a/Help/release/dev/cmake-W-options.rst b/Help/release/dev/cmake-W-options.rst
index 57d375f..38e71f9 100644
--- a/Help/release/dev/cmake-W-options.rst
+++ b/Help/release/dev/cmake-W-options.rst
@@ -10,3 +10,6 @@ cmake-W-options
 * Warnings about deprecated functionality are now enabled by default.
   They may be suppressed with ``-Wno-deprecated`` or by setting the
   :variable:`CMAKE_WARN_DEPRECATED` variable to false.
+
+* Warnings about deprecated functionality can now be controlled in the
+  :manual:`cmake-gui(1)` application.
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index cad11f5..9161ad3 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -115,6 +115,8 @@ set(SRCS
   QCMakeWidgets.h
   RegexExplorer.cxx
   RegexExplorer.h
+  WarningMessagesDialog.cxx
+  WarningMessagesDialog.h
   )
 QT4_WRAP_UI(UI_SRCS
   CMakeSetupDialog.ui
@@ -122,6 +124,7 @@ QT4_WRAP_UI(UI_SRCS
   CrossCompiler.ui
   AddCacheEntry.ui
   RegexExplorer.ui
+  WarningMessagesDialog.ui
   )
 QT4_WRAP_CPP(MOC_SRCS
   AddCacheEntry.h
@@ -132,6 +135,7 @@ QT4_WRAP_CPP(MOC_SRCS
   QCMakeCacheView.h
   QCMakeWidgets.h
   RegexExplorer.h
+  WarningMessagesDialog.h
   )
 QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc)
 
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 2b12834..2fc4faf 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -34,6 +34,7 @@
 #include "AddCacheEntry.h"
 #include "FirstConfigure.h"
 #include "RegexExplorer.h"
+#include "WarningMessagesDialog.h"
 #include "cmSystemTools.h"
 #include "cmVersion.h"
 
@@ -145,9 +146,8 @@ CMakeSetupDialog::CMakeSetupDialog()
this, SLOT(doOutputErrorNext()));  // in Eclipse
 
   QMenu* OptionsMenu = this->menuBar()->addMenu(tr(""));
-  this->SuppressDevWarningsAction =
-OptionsMenu->addAction(tr(" dev Warnings (-Wno-dev)"));
-  this->SuppressDevWarningsAction->setCheckable(true);
+  OptionsMenu->addAction(tr("Warning Messages..."),
+ this, SLOT(doWarningMessagesDialog()));
   this->WarnUninitializedAction =
 OptionsMenu->addAction(tr(" Uninitialized (--warn-uninitialized)"));
   this->WarnUninitializedAction->setCheckable(true);
@@ -278,9 +278,6 @@ void CMakeSetupDialog::initialize()
   QObject::connect(this->AddEntry, SIGNAL(clicked(bool)),
this, SLOT(addCacheEntry()));
 
-  QObject::connect(this->SuppressDevWarningsAction, SIGNAL(triggered(bool)),
-   this->CMakeThread->cmakeInstance(), SLOT(setSuppressDevWarnings(bool)));
-
   QObject::connect(this->WarnUninitializedAction, SIGNAL(triggered(bool)),
this->CMakeThread->cmakeInstance(),
SLOT(setWarnUninitializedMode(bool)));
@@ -1369,3 +1366,9 @@ void CMakeSetupDialog::doOutputErrorNext()
 this->Output->setTextCursor(textCursor);
 }
 }
+
+void CMakeSetupDialog::doWarningMessagesDialog()
+{
+  WarningMessagesDialog dialog(this, this->CMakeThread->cmakeInstance());
+  dialog.exec();
+}
diff --git 

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

2015-12-04 Thread Brad King
On 12/04/2015 10:05 AM, Michael Scott wrote:
> The build tree is selected by changing the source directory setting in 
> the GUI right?

Actually when one choose a build tree it will locate the corresponding
source tree automatically if both exist.  Selecting the source tree
may be followed by creating a new build tree so that direction does
not happen automatically IIRC.

> Adding in one toggle would be fine, but I imagine that when we come to 
> adding support for upgrading warnings to errors, the additional two 
> checkboxes would be a bit much. I was thinking of perhaps instead having 
> just one entry in the options menu, which opens up a sub-window which 
> contains the group of message related options.

Yes.  Please move the -Wdev options there too.  Actually since it is
a property of the build tree selected and not of the overall session,
perhaps the button for these settings should not be in the menu but
in the dialog box somewhere below.

Thanks,
-Brad

P.S.  Your mailer broke the thread again.

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-12-04 Thread Michael Scott

Let's start with the toggle because that will make cmake-gui able
to set the option just like the command line.

Sounds good, that's what I was thinking as well.


Also I'm not sure what to do about persistence of the option check
boxes in cmake-gui when selecting a different build tree.  As a user
I may expect those options to be loaded from the current cache in each
build tree I select.
The build tree is selected by changing the source directory setting in 
the GUI right? So it should get the state of the checkboxes based on the 
cache whenever this changes.


Adding in one toggle would be fine, but I imagine that when we come to 
adding support for upgrading warnings to errors, the additional two 
checkboxes would be a bit much. I was thinking of perhaps instead having 
just one entry in the options menu, which opens up a sub-window which 
contains the group of message related options.


Cheers,
Michale

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-12-04 Thread Michael Scott

Actually when one choose a build tree it will locate the corresponding
source tree automatically if both exist.  Selecting the source tree
may be followed by creating a new build tree so that direction does
not happen automatically IIRC.
Okay, I'm not too familiar with the GUI, how do you choose a build tree? 
So that I can look at where I can hook in the message cache detection.



Your mailer broke the thread again.

Sorry, this one shouldn't break the thread.


Cheers,
Michael
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-12-04 Thread Brad King
On 12/03/2015 05:56 PM, Michael Scott wrote:
>> Thanks.  Applied with minor tweaks and merged to 'next' for testing:
> 
> That's great, thanks. Now that the patches are in, would you say it's 
> better to work on adding a deprecated toggle option to the cmake-gui, or 
> to work on adding support for upgrading warnings to errors?

Let's start with the toggle because that will make cmake-gui able
to set the option just like the command line.  Note that as part
of integrating your changes I changed the CMAKE_WARN_DEPRECATED
cache entry to INTERNAL instead of BOOL so it won't show up in
the cmake-gui.  Therefore a dedicated switch would be useful.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-12-04 Thread Brad King
On 12/04/2015 10:52 AM, Michael Scott wrote:
>> Actually when one choose a build tree it will locate the corresponding
>> source tree automatically if both exist.  Selecting the source tree
>> may be followed by creating a new build tree so that direction does
>> not happen automatically IIRC.
> Okay, I'm not too familiar with the GUI, how do you choose a build tree? 
> So that I can look at where I can hook in the message cache detection.

There are two directory fields:

 "Where is the source code:"

 "Where to build the binaries:"

The latter is the build tree selection.

>> Your mailer broke the thread again.
> Sorry, this one shouldn't break the thread.

It did.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-12-03 Thread Michael Scott

Thanks.  Applied with minor tweaks and merged to 'next' for testing:


That's great, thanks. Now that the patches are in, would you say it's 
better to work on adding a deprecated toggle option to the cmake-gui, or 
to work on adding support for upgrading warnings to errors?


Cheers,
Michael
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-12-01 Thread Brad King
On 11/30/2015 02:16 PM, Michael Scott wrote:
> Great, I've changed the nullptr references to NULL instead.

Thanks.  Applied with minor tweaks and merged to 'next' for testing:

 Merge topic 'cmake-W-options' into next
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cfcc9d52

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-11-30 Thread Michael Scott

Great, I've changed the nullptr references to NULL instead.

Cheers,
Michael
>From 02016a44d1f6f571b96c54a0008c37e2e1fa3b7d Mon Sep 17 00:00:00 2001
From: Michael Scott 
Date: Sun, 1 Nov 2015 16:05:15 +
Subject: [PATCH 1/8] Tests: Revise message in RunCMake.CommandLine -Wdev case

Use more prose-like capitalization.
---
 Tests/RunCMake/CommandLine/Wdev-stderr.txt | 2 +-
 Tests/RunCMake/CommandLine/Wdev.cmake  | 2 +-
 Tests/RunCMake/CommandLine/Wno-dev.cmake   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Tests/RunCMake/CommandLine/Wdev-stderr.txt b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
index 92c1d23..88cfb3a 100644
--- a/Tests/RunCMake/CommandLine/Wdev-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
@@ -1,5 +1,5 @@
 ^CMake Warning \(dev\) at Wdev.cmake:1 \(message\):
-  Some Author Warning
+  Some author warning
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CommandLine/Wdev.cmake b/Tests/RunCMake/CommandLine/Wdev.cmake
index e5026ef..756f31e 100644
--- a/Tests/RunCMake/CommandLine/Wdev.cmake
+++ b/Tests/RunCMake/CommandLine/Wdev.cmake
@@ -1,4 +1,4 @@
-message(AUTHOR_WARNING "Some Author Warning")
+message(AUTHOR_WARNING "Some author warning")
 
 # with -Wdev this will also cause an AUTHOR_WARNING message, checks that
 # messages issued outside of the message command, by other CMake commands, also
diff --git a/Tests/RunCMake/CommandLine/Wno-dev.cmake b/Tests/RunCMake/CommandLine/Wno-dev.cmake
index d81b858..802b435 100644
--- a/Tests/RunCMake/CommandLine/Wno-dev.cmake
+++ b/Tests/RunCMake/CommandLine/Wno-dev.cmake
@@ -1,4 +1,4 @@
-message(AUTHOR_WARNING "Some Author Warning")
+message(AUTHOR_WARNING "Some author warning")
 
 # without -Wno-dev this will also cause an AUTHOR_WARNING message, checks that
 # messages issued outside of the message command, by other CMake commands, also
-- 
2.5.0

>From 10801dab11c8e81ac351f725c37e30555f7febcf Mon Sep 17 00:00:00 2001
From: Michael Scott 
Date: Sun, 8 Nov 2015 12:20:47 +
Subject: [PATCH 2/8] Make message suppression more consistent.

Make the message suppression more consistent, by adding a check
for the message related CMake variables in cmake::IssueMessage,
which allows callers of IssueMessage other than the message
command to behave as expected. Also added a check for
CMAKE_SUPPRESS_DEVELOPER_WARNINGS in the message command to
mirror the deprecated message type behaviour.

Added a 'force' flag to the cmake::IssueMessage method, to
make the message suppression consistent, when setting the
message related CMake variables directly in a CMake file.

Expand message command tests to cover the AUTHOR_WARNING message
type as well.
---
 Source/cmMakefile.cxx |  8 +--
 Source/cmMakefile.h   |  3 +-
 Source/cmMessageCommand.cxx   | 12 -
 Source/cmake.cxx  | 70 ++-
 Source/cmake.h| 12 -
 Tests/RunCMake/message/nomessage.cmake|  4 ++
 Tests/RunCMake/message/warnmessage-stderr.txt | 11 -
 Tests/RunCMake/message/warnmessage.cmake  |  6 ++-
 8 files changed, 102 insertions(+), 24 deletions(-)

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index a1f143a..fd93a41 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -130,7 +130,8 @@ cmMakefile::~cmMakefile()
 
 //
 void cmMakefile::IssueMessage(cmake::MessageType t,
-  std::string const& text) const
+  std::string const& text,
+  bool force) const
 {
   // Collect context information.
   if(!this->ExecutionStatusStack.empty())
@@ -139,7 +140,8 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
   {
   this->ExecutionStatusStack.back()->SetNestedError(true);
   }
-this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace());
+this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace(),
+   force);
 }
   else
 {
@@ -154,7 +156,7 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
   lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME);
   }
 lfc.Line = 0;
-this->GetCMakeInstance()->IssueMessage(t, text, lfc);
+this->GetCMakeInstance()->IssueMessage(t, text, lfc, force);
 }
 }
 
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 4215b72..e89f772 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -719,7 +719,8 @@ public:
   };
 
   void IssueMessage(cmake::MessageType t,
-std::string const& text) const;
+std::string const& text,
+bool 

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

2015-11-30 Thread Brad King
On 11/29/2015 08:48 AM, Michael Scott wrote:
> I've gone back and redone the patches with the suggestions you made

Thanks.  This is in pretty good shape now I think.  However, I see
use of `nullptr`.  Please revise to use only C++98 constructs.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-11-29 Thread Michael Scott

Hi Brad,

I've gone back and redone the patches with the suggestions you made, 
hopefully they should be acceptable to apply now.


 * The Help/release/dev/cmake-W-options.rst file is now modified as
   part of the patches
 * The method of enabling dev and deprecated warnings by default no
   longer sets the CMake variables, instead it's handled by the new
   GetSuppressDevWarnings and GetSuppressDeprecatedWarnings methods
 * The change of enabling deprecated warnings by default is now in a
   separate patch (0008)


I haven't included any patches for the cmake-gui as I want to get these 
bits nailed down and in first.


Cheers,
Michael
>From 02016a44d1f6f571b96c54a0008c37e2e1fa3b7d Mon Sep 17 00:00:00 2001
From: Michael Scott 
Date: Sun, 1 Nov 2015 16:05:15 +
Subject: [PATCH 1/8] Tests: Revise message in RunCMake.CommandLine -Wdev case

Use more prose-like capitalization.
---
 Tests/RunCMake/CommandLine/Wdev-stderr.txt | 2 +-
 Tests/RunCMake/CommandLine/Wdev.cmake  | 2 +-
 Tests/RunCMake/CommandLine/Wno-dev.cmake   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Tests/RunCMake/CommandLine/Wdev-stderr.txt b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
index 92c1d23..88cfb3a 100644
--- a/Tests/RunCMake/CommandLine/Wdev-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
@@ -1,5 +1,5 @@
 ^CMake Warning \(dev\) at Wdev.cmake:1 \(message\):
-  Some Author Warning
+  Some author warning
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CommandLine/Wdev.cmake b/Tests/RunCMake/CommandLine/Wdev.cmake
index e5026ef..756f31e 100644
--- a/Tests/RunCMake/CommandLine/Wdev.cmake
+++ b/Tests/RunCMake/CommandLine/Wdev.cmake
@@ -1,4 +1,4 @@
-message(AUTHOR_WARNING "Some Author Warning")
+message(AUTHOR_WARNING "Some author warning")
 
 # with -Wdev this will also cause an AUTHOR_WARNING message, checks that
 # messages issued outside of the message command, by other CMake commands, also
diff --git a/Tests/RunCMake/CommandLine/Wno-dev.cmake b/Tests/RunCMake/CommandLine/Wno-dev.cmake
index d81b858..802b435 100644
--- a/Tests/RunCMake/CommandLine/Wno-dev.cmake
+++ b/Tests/RunCMake/CommandLine/Wno-dev.cmake
@@ -1,4 +1,4 @@
-message(AUTHOR_WARNING "Some Author Warning")
+message(AUTHOR_WARNING "Some author warning")
 
 # without -Wno-dev this will also cause an AUTHOR_WARNING message, checks that
 # messages issued outside of the message command, by other CMake commands, also
-- 
2.5.0

>From 10801dab11c8e81ac351f725c37e30555f7febcf Mon Sep 17 00:00:00 2001
From: Michael Scott 
Date: Sun, 8 Nov 2015 12:20:47 +
Subject: [PATCH 2/8] Make message suppression more consistent.

Make the message suppression more consistent, by adding a check
for the message related CMake variables in cmake::IssueMessage,
which allows callers of IssueMessage other than the message
command to behave as expected. Also added a check for
CMAKE_SUPPRESS_DEVELOPER_WARNINGS in the message command to
mirror the deprecated message type behaviour.

Added a 'force' flag to the cmake::IssueMessage method, to
make the message suppression consistent, when setting the
message related CMake variables directly in a CMake file.

Expand message command tests to cover the AUTHOR_WARNING message
type as well.
---
 Source/cmMakefile.cxx |  8 +--
 Source/cmMakefile.h   |  3 +-
 Source/cmMessageCommand.cxx   | 12 -
 Source/cmake.cxx  | 70 ++-
 Source/cmake.h| 12 -
 Tests/RunCMake/message/nomessage.cmake|  4 ++
 Tests/RunCMake/message/warnmessage-stderr.txt | 11 -
 Tests/RunCMake/message/warnmessage.cmake  |  6 ++-
 8 files changed, 102 insertions(+), 24 deletions(-)

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index a1f143a..fd93a41 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -130,7 +130,8 @@ cmMakefile::~cmMakefile()
 
 //
 void cmMakefile::IssueMessage(cmake::MessageType t,
-  std::string const& text) const
+  std::string const& text,
+  bool force) const
 {
   // Collect context information.
   if(!this->ExecutionStatusStack.empty())
@@ -139,7 +140,8 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
   {
   this->ExecutionStatusStack.back()->SetNestedError(true);
   }
-this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace());
+this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace(),
+   force);
 }
   else
 {
@@ -154,7 +156,7 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
   

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

2015-11-18 Thread Brad King
On 11/18/2015 02:41 AM, Michael Scott wrote:
>> I moved the hunk below forward to "Modify dev warning options to affect
>> deprecated warnings", the commit where it actually becomes needed
>> because the default changes.
> I'm not sure I follow, which hunk are we talking about here?

The hunk I included at the bottom of the message: adding the

  set(CMAKE_WARN_DEPRECATED OFF)

line to "Tests/RunCMake/message/nomessage.cmake" so that the test
passes once the default is to enable deprecation warnings.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-11-18 Thread Michael Scott

Hi Brad,


The hunk I included at the bottom of the message
Ah yeah, sorry missed that part in the message, I understand the change 
that needs to be done now.



The current caching logic still needs some work
One idea that comes to mind, is to change it so that it doesn't enable 
dev/deprecated warnings by default by setting the DiagLevels map, 
instead we create a specific function to get the status of dev warnings 
suppression, which checks the cache variables (now set only if user 
explicitly used -W options) but by default returns a value to signify 
enable dev warnings. I think this would get around the mentioned issue, 
but needs some playing about with to see if its a solution.


Cheers,
Michael

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-11-17 Thread Michael Scott

In particular,
I moved the hunk below forward to "Modify dev warning options to affect
deprecated warnings", the commit where it actually becomes needed
because the default changes.

I'm not sure I follow, which hunk are we talking about here?


Please add a Help/release/dev/cmake-W-options.rst file with release
notes for these changes.

Okay no problem.


This
means that adding "-Wno-dev" on a non-initial configuration will not
disable deprecation warnings because CMAKE_WARN_DEPRECATED is already
cached even though no explicit -W option was given before.

Ah that's a good point, I hadn't considered that set of steps, thanks.


As a user
I may expect those options to be loaded from the current cache in each
build tree I select.
Okay well I'll remove the related patch from the set for now and come 
back to it after we've got the main sorted out and applied.


Cheers,
Michael



--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-11-16 Thread Brad King
On 11/13/2015 04:51 PM, Michael Scott wrote:
> Here's the original patch split up into smaller more specific patches. 
> Let me know if there's any issues or if everything's okay, so I can 
> continue with the rest of the intended changes.

Thanks.  That is much easier to review and see the purpose of each hunk.

I've revised the patches slightly.  See attached series.  In particular,
I moved the hunk below forward to "Modify dev warning options to affect
deprecated warnings", the commit where it actually becomes needed
because the default changes.

Please precede this commit with a change that includes this hunk and
an explicit change to the default.  That way we call out the change
to the default with an explicit commit that is separate from the
additional new behavior of making -Wdev affect -Wdeprecated.

Please add a Help/release/dev/cmake-W-options.rst file with release
notes for these changes.  Mention the change in default deprecation
warnings in the release notes.  Look back at commit c96fe0b4 for the
release notes we almost used for 3.4.

The current caching logic still needs some work.  It looks like both
CMAKE_WARN_DEPRECATED and CMAKE_SUPPRESS_DEVELOPER_WARNINGS end up
in the cache right now even if no explicit options were given.  This
means that adding "-Wno-dev" on a non-initial configuration will not
disable deprecation warnings because CMAKE_WARN_DEPRECATED is already
cached even though no explicit -W option was given before.  Please
revise the logic so that these variables are cached only if the
corresponding options are explicitly set.

Also I'm not sure what to do about persistence of the option check
boxes in cmake-gui when selecting a different build tree.  As a user
I may expect those options to be loaded from the current cache in each
build tree I select.

Thanks,
-Brad

diff --git a/Tests/RunCMake/message/nomessage.cmake 
b/Tests/RunCMake/message/nomessage.cmake
index 582ab4d..0ff951a 100644
--- a/Tests/RunCMake/message/nomessage.cmake
+++ b/Tests/RunCMake/message/nomessage.cmake
@@ -1,3 +1,4 @@
+set(CMAKE_WARN_DEPRECATED OFF)

 message(DEPRECATION "This is not issued")

>From abbeb16c47e05c97653cd2c4f854653b83e32e2a Mon Sep 17 00:00:00 2001
Message-Id: 
From: Michael Scott 
Date: Sun, 1 Nov 2015 16:05:15 +
Subject: [PATCH 1/8] Tests: Revise message in RunCMake.CommandLine -Wdev case

Use more prose-like capitalization.
---
 Tests/RunCMake/CommandLine/Wdev-stderr.txt | 2 +-
 Tests/RunCMake/CommandLine/Wdev.cmake  | 2 +-
 Tests/RunCMake/CommandLine/Wno-dev.cmake   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Tests/RunCMake/CommandLine/Wdev-stderr.txt b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
index 92c1d23..88cfb3a 100644
--- a/Tests/RunCMake/CommandLine/Wdev-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
@@ -1,5 +1,5 @@
 ^CMake Warning \(dev\) at Wdev.cmake:1 \(message\):
-  Some Author Warning
+  Some author warning
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CommandLine/Wdev.cmake b/Tests/RunCMake/CommandLine/Wdev.cmake
index e5026ef..756f31e 100644
--- a/Tests/RunCMake/CommandLine/Wdev.cmake
+++ b/Tests/RunCMake/CommandLine/Wdev.cmake
@@ -1,4 +1,4 @@
-message(AUTHOR_WARNING "Some Author Warning")
+message(AUTHOR_WARNING "Some author warning")
 
 # with -Wdev this will also cause an AUTHOR_WARNING message, checks that
 # messages issued outside of the message command, by other CMake commands, also
diff --git a/Tests/RunCMake/CommandLine/Wno-dev.cmake b/Tests/RunCMake/CommandLine/Wno-dev.cmake
index d81b858..802b435 100644
--- a/Tests/RunCMake/CommandLine/Wno-dev.cmake
+++ b/Tests/RunCMake/CommandLine/Wno-dev.cmake
@@ -1,4 +1,4 @@
-message(AUTHOR_WARNING "Some Author Warning")
+message(AUTHOR_WARNING "Some author warning")
 
 # without -Wno-dev this will also cause an AUTHOR_WARNING message, checks that
 # messages issued outside of the message command, by other CMake commands, also
-- 
2.6.2

>From 4b04e612d35d16df9a7eb469f2c3610877430230 Mon Sep 17 00:00:00 2001
Message-Id: <4b04e612d35d16df9a7eb469f2c3610877430230.1447687388.git.brad.k...@kitware.com>
In-Reply-To: 
References: 
From: Michael Scott 
Date: Sun, 8 Nov 2015 12:20:47 +
Subject: [PATCH 2/8] Make message suppression more consistent.

Make the message suppression more consistent, by adding a check
for the message related CMake variables in cmake::IssueMessage,
which allows callers of IssueMessage other than the message
command to behave as expected. Also added a check for
CMAKE_SUPPRESS_DEVELOPER_WARNINGS in the message command to
mirror the deprecated 

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

2015-11-15 Thread Michael Scott
Here's also a further patch for this set, to add the option to suppress 
deprecated warning messages to the QT GUI. I'm not sure if it matters or 
not about the "[PATCH 1/X]" in the patch's subject line, so I've 
attached the other patches in the set again just with an updated count, 
in case it does matter.


Cheers,
Michael
>From cc16db0e2c818714034e2948a0b3b16b7774252f Mon Sep 17 00:00:00 2001
From: Michael Scott 
Date: Sun, 15 Nov 2015 17:47:12 +
Subject: [PATCH 8/8] GUI option for deprecated warning messages suppression.

Add an option to the CMake GUI to toggle suppression of deprecated
warning messages.
---
 Source/QtDialog/CMakeSetupDialog.cxx |  8 
 Source/QtDialog/CMakeSetupDialog.h   |  1 +
 Source/QtDialog/QCMake.cxx   |  8 
 Source/QtDialog/QCMake.h |  3 +++
 Source/cmake.cxx | 15 +++
 Source/cmake.h   |  1 +
 6 files changed, 36 insertions(+)

diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 03417f3..61d6b1d 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -144,6 +144,10 @@ CMakeSetupDialog::CMakeSetupDialog()
   this->SuppressDevWarningsAction =
 OptionsMenu->addAction(tr(" dev Warnings (-Wno-dev)"));
   this->SuppressDevWarningsAction->setCheckable(true);
+  this->SuppressDeprecatedWarningsAction =
+OptionsMenu->addAction(
+  tr(" Deprecated Warnings (-Wno-deprecated)"));
+  this->SuppressDeprecatedWarningsAction->setCheckable(true);
   this->WarnUninitializedAction =
 OptionsMenu->addAction(tr(" Uninitialized (--warn-uninitialized)"));
   this->WarnUninitializedAction->setCheckable(true);
@@ -276,6 +280,10 @@ void CMakeSetupDialog::initialize()
 
   QObject::connect(this->SuppressDevWarningsAction, SIGNAL(triggered(bool)),
this->CMakeThread->cmakeInstance(), SLOT(setSuppressDevWarnings(bool)));
+  QObject::connect(this->SuppressDeprecatedWarningsAction,
+   SIGNAL(triggered(bool)),
+   this->CMakeThread->cmakeInstance(),
+   SLOT(setSuppressDeprecatedWarnings(bool)));
 
   QObject::connect(this->WarnUninitializedAction, SIGNAL(triggered(bool)),
this->CMakeThread->cmakeInstance(),
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 1b26c64..6cc8de3 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -102,6 +102,7 @@ protected:
   QAction* ConfigureAction;
   QAction* GenerateAction;
   QAction* SuppressDevWarningsAction;
+  QAction* SuppressDeprecatedWarningsAction;
   QAction* WarnUninitializedAction;
   QAction* WarnUnusedAction;
   QAction* InstallForCommandLineAction;
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 9edbb20..c1c7005 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -28,6 +28,7 @@ QCMake::QCMake(QObject* p)
   : QObject(p)
 {
   this->SuppressDevWarnings = false;
+  this->SuppressDeprecatedWarnings = false;
   this->WarnUninitializedMode = false;
   this->WarnUnusedMode = false;
   qRegisterMetaType();
@@ -151,6 +152,8 @@ void QCMake::configure()
   this->CMakeInstance->SetGeneratorToolset("");
   this->CMakeInstance->LoadCache();
   this->CMakeInstance->SetSuppressDevWarnings(this->SuppressDevWarnings);
+  this->CMakeInstance->SetSuppressDeprecatedWarnings(
+this->SuppressDeprecatedWarnings);
   this->CMakeInstance->SetWarnUninitialized(this->WarnUninitializedMode);
   this->CMakeInstance->SetWarnUnused(this->WarnUnusedMode);
   this->CMakeInstance->PreLoadCMakeFiles();
@@ -445,6 +448,11 @@ void QCMake::setSuppressDevWarnings(bool value)
   this->SuppressDevWarnings = value;
 }
 
+void QCMake::setSuppressDeprecatedWarnings(bool value)
+{
+  this->SuppressDeprecatedWarnings = value;
+}
+
 void QCMake::setWarnUninitializedMode(bool value)
 {
   this->WarnUninitializedMode = value;
diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
index d910eb7..a50f8ae 100644
--- a/Source/QtDialog/QCMake.h
+++ b/Source/QtDialog/QCMake.h
@@ -89,6 +89,8 @@ public slots:
   void setDebugOutput(bool);
   /// set whether to do suppress dev warnings
   void setSuppressDevWarnings(bool value);
+  /// set whether to do suppress deprecated warnings
+  void setSuppressDeprecatedWarnings(bool value);
   /// set whether to run cmake with warnings about uninitialized variables
   void setWarnUninitializedMode(bool value);
   /// set whether to run cmake with warnings about unused variables
@@ -141,6 +143,7 @@ protected:
   static void stdoutCallback(const char* msg, size_t len, void* cd);
   static void stderrCallback(const char* msg, size_t len, void* cd);
   bool SuppressDevWarnings;
+  bool SuppressDeprecatedWarnings;
   bool WarnUninitializedMode;
   bool WarnUnusedMode;
   bool WarnUnusedAllMode;
diff --git a/Source/cmake.cxx 

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

2015-11-13 Thread Michael Scott

Hi Brad,

Here's the original patch split up into smaller more specific patches. 
Let me know if there's any issues or if everything's okay, so I can 
continue with the rest of the intended changes.


Cheers,
Michael
From 48d8c38c7b5724e4b6b53fa8647046c96cec603b Mon Sep 17 00:00:00 2001
From: Michael Scott 
Date: Sun, 1 Nov 2015 16:05:15 +
Subject: [PATCH 1/7] Tests: Revise message in RunCMake.CommandLine -Wdev case

Use more prose-like capitalization.
---
 Tests/RunCMake/CommandLine/Wdev-stderr.txt | 2 +-
 Tests/RunCMake/CommandLine/Wdev.cmake  | 2 +-
 Tests/RunCMake/CommandLine/Wno-dev.cmake   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Tests/RunCMake/CommandLine/Wdev-stderr.txt 
b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
index 92c1d23..88cfb3a 100644
--- a/Tests/RunCMake/CommandLine/Wdev-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
@@ -1,5 +1,5 @@
 ^CMake Warning \(dev\) at Wdev.cmake:1 \(message\):
-  Some Author Warning
+  Some author warning
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CommandLine/Wdev.cmake 
b/Tests/RunCMake/CommandLine/Wdev.cmake
index e5026ef..756f31e 100644
--- a/Tests/RunCMake/CommandLine/Wdev.cmake
+++ b/Tests/RunCMake/CommandLine/Wdev.cmake
@@ -1,4 +1,4 @@
-message(AUTHOR_WARNING "Some Author Warning")
+message(AUTHOR_WARNING "Some author warning")
 
 # with -Wdev this will also cause an AUTHOR_WARNING message, checks that
 # messages issued outside of the message command, by other CMake commands, also
diff --git a/Tests/RunCMake/CommandLine/Wno-dev.cmake 
b/Tests/RunCMake/CommandLine/Wno-dev.cmake
index d81b858..802b435 100644
--- a/Tests/RunCMake/CommandLine/Wno-dev.cmake
+++ b/Tests/RunCMake/CommandLine/Wno-dev.cmake
@@ -1,4 +1,4 @@
-message(AUTHOR_WARNING "Some Author Warning")
+message(AUTHOR_WARNING "Some author warning")
 
 # without -Wno-dev this will also cause an AUTHOR_WARNING message, checks that
 # messages issued outside of the message command, by other CMake commands, also
-- 
2.1.4

From e60002e10f2ea10cadac74bd8c3a2d23cb35be4a Mon Sep 17 00:00:00 2001
From: Michael Scott 
Date: Sun, 8 Nov 2015 12:20:47 +
Subject: [PATCH 2/7] Make message suppression more consistent.

Make the message suppression more consistent, by adding a check
for the message related CMake variables in cmake::IssueMessage,
which allows callers of IssueMessage other than the message
command to behave as expected. Also added a check for
CMAKE_SUPPRESS_DEVELOPER_WARNINGS in the message command to
mirror the deprecated message type behaviour.

Added a 'force' flag to the cmake::IssueMessage method, to
make the message suppression consistent, when setting the
message related CMake variables directly in a CMake file.

Expand message command tests to cover the AUTHOR_WARNING message
type as well.
---
 Source/cmMakefile.cxx |  8 +--
 Source/cmMakefile.h   |  3 +-
 Source/cmMessageCommand.cxx   | 12 -
 Source/cmake.cxx  | 70 ++-
 Source/cmake.h| 12 -
 Tests/RunCMake/message/nomessage.cmake|  5 ++
 Tests/RunCMake/message/warnmessage-stderr.txt | 11 -
 Tests/RunCMake/message/warnmessage.cmake  |  6 ++-
 8 files changed, 103 insertions(+), 24 deletions(-)

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index a1f143a..fd93a41 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -130,7 +130,8 @@ cmMakefile::~cmMakefile()
 
 //
 void cmMakefile::IssueMessage(cmake::MessageType t,
-  std::string const& text) const
+  std::string const& text,
+  bool force) const
 {
   // Collect context information.
   if(!this->ExecutionStatusStack.empty())
@@ -139,7 +140,8 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
   {
   this->ExecutionStatusStack.back()->SetNestedError(true);
   }
-this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace());
+this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace(),
+   force);
 }
   else
 {
@@ -154,7 +156,7 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
   lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME);
   }
 lfc.Line = 0;
-this->GetCMakeInstance()->IssueMessage(t, text, lfc);
+this->GetCMakeInstance()->IssueMessage(t, text, lfc, force);
 }
 }
 
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 4215b72..e89f772 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -719,7 +719,8 @@ public:
   };
 
   void 

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

2015-11-09 Thread Brad King
On 11/06/2015 05:31 PM, Michael Scott wrote:
>> increments the count by default instead of only when an explicit
>> option has been set.  Please revise accordingly based on the attached
>> state.
> I don't quite follow. Setting "dev" to DIAG_WARN in DiagLevels, before
> the users input is parsed (which will override the default "dev" value

The goal of the old logic was to avoid populating the settings in the
cache if they are left as default.  Instead you could check whether any
"dev" value has been set *after* parsing the options and if not then
set it to the default.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-11-09 Thread Michael Scott

The goal of the old logic was to avoid populating the settings in the
cache if they are left as default.  Instead you could check whether any
"dev" value has been set *after* parsing the options and if not then
set it to the default.


Ah okay I understand, that's no problem.

I've pretty much finished splitting up the original patch into about 
seven separate patches, should be able to submit later on this week.


Cheers,
Michael
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-11-06 Thread Michael Scott

Thanks for the feedback.


Please split up the rest of the patch into a
series of steps like that

Okay I'll see if I can break it down further.


ignoreWarningLevels => force

Yes that does sound better, thanks.


increments the count by default instead of only when an explicit
option has been set.  Please revise accordingly based on the attached
state.
I don't quite follow. Setting "dev" to DIAG_WARN in DiagLevels, before 
the users input is parsed (which will override the default "dev" value, 
if any is specified), seems the clearest and most straightforward way to 
enable author *and **deprecate**d *warnings by default. What would the 
alternative be, apart from having another instance where the applicable 
CMake variables are set?


Cheers,
Michael
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

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

2015-11-06 Thread Brad King
On 11/04/2015 06:40 PM, Michael Scott wrote:
> Here is the patch with all, new, error related code removed and 
> including the relevant documentation changes.

Thanks.  Now this is getting down closer to a reviewable scale.
However, this will be much easier to review as a series of small
incremental self-contained changes.  The current patch contains

* Text updates in existing tests
* Change in role of deprecation warnings
* Change to default deprecation warning state
* Change to cache storage of warning states
* Change in internal data structures and diagnostic state tracking
* etc.

This is too much to follow in one patch.

See attached patches for some updates.  I split out a starting patch
as an example of incremental changes.  Now those hunks don't clutter
the larger changes.  Please split up the rest of the patch into a
series of steps like that.  It may involve some intermediate code
that is added in one patch and replaced in the next, but that is okay.
That makes it much easier to review and much easier to bisect problems
in the future.

I renamed some structures in the revised patches:

 WarningLevel => DiagLevel
 ignoreWarningLevels => force

On the actual logic changes, the role of DoSuppressDevWarnings appears
to have been replaced by checking DiagLevels[...].count().  However,
then this hunk:

> +  // turn on author, and in turn deprecated, warnings (only) by default
> +  this->DiagLevels["dev"] = DIAG_WARN;

increments the count by default instead of only when an explicit
option has been set.  Please revise accordingly based on the attached
state.

Thanks,
-Brad

>From b80e1ab0b47df68aa7e46b424080447c7668c2f5 Mon Sep 17 00:00:00 2001
Message-Id: 
From: Michael Scott 
Date: Sun, 1 Nov 2015 16:05:15 +
Subject: [PATCH 1/2] Tests: Revise message in RunCMake.CommandLine -Wdev case

Use more prose-like capitalization.
---
 Tests/RunCMake/CommandLine/Wdev-stderr.txt | 2 +-
 Tests/RunCMake/CommandLine/Wdev.cmake  | 2 +-
 Tests/RunCMake/CommandLine/Wno-dev.cmake   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Tests/RunCMake/CommandLine/Wdev-stderr.txt b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
index 92c1d23..88cfb3a 100644
--- a/Tests/RunCMake/CommandLine/Wdev-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
@@ -1,5 +1,5 @@
 ^CMake Warning \(dev\) at Wdev.cmake:1 \(message\):
-  Some Author Warning
+  Some author warning
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CommandLine/Wdev.cmake b/Tests/RunCMake/CommandLine/Wdev.cmake
index e5026ef..756f31e 100644
--- a/Tests/RunCMake/CommandLine/Wdev.cmake
+++ b/Tests/RunCMake/CommandLine/Wdev.cmake
@@ -1,4 +1,4 @@
-message(AUTHOR_WARNING "Some Author Warning")
+message(AUTHOR_WARNING "Some author warning")
 
 # with -Wdev this will also cause an AUTHOR_WARNING message, checks that
 # messages issued outside of the message command, by other CMake commands, also
diff --git a/Tests/RunCMake/CommandLine/Wno-dev.cmake b/Tests/RunCMake/CommandLine/Wno-dev.cmake
index d81b858..802b435 100644
--- a/Tests/RunCMake/CommandLine/Wno-dev.cmake
+++ b/Tests/RunCMake/CommandLine/Wno-dev.cmake
@@ -1,4 +1,4 @@
-message(AUTHOR_WARNING "Some Author Warning")
+message(AUTHOR_WARNING "Some author warning")
 
 # without -Wno-dev this will also cause an AUTHOR_WARNING message, checks that
 # messages issued outside of the message command, by other CMake commands, also
-- 
2.6.1

>From b86af1f7f5c48a60ae874f9b75641c37d3ba1269 Mon Sep 17 00:00:00 2001
Message-Id: 
In-Reply-To: 
References: 
From: Michael Scott 
Date: Sun, 1 Nov 2015 16:05:15 +
Subject: [PATCH 2/2] Add -W options to control deprecation and author warnings

Refactor the -Wdev and -Wno-dev options parser to use a generic -W
parser that follows the GCC pattern, excluding support for
-Werror=TYPE and -Wno-error=TYPE formats for now.

Add 'deprecated' warning options type, to allow setting
CMAKE_WARN_DEPRECATED via the -W options.

Make author and deprecated warnings enabled by default.

Add tests for new options and updated documentation.
---
 Help/manual/OPTIONS_BUILD.txt |  17 +-
 Help/variable/CMAKE_ERROR_DEPRECATED.rst  |   7 +-
 Help/variable/CMAKE_WARN_DEPRECATED.rst   |   9 +-
 Source/cmMakefile.cxx |   8 +-
 Source/cmMakefile.h   |   3 +-
 Source/cmMessageCommand.cxx   |  12 +-
 Source/cmake.cxx  | 240 ++
 

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

2015-11-04 Thread Michael Scott

Okay fair enough.

Here is the patch with all, new, error related code removed and 
including the relevant documentation changes.


Cheers,
Michael
From 2d6bb2c1ddd6854bc1f26f92893e9e8a745db08b Mon Sep 17 00:00:00 2001
From: Michael Scott 
Date: Sun, 1 Nov 2015 16:05:15 +
Subject: [PATCH] Add -W options to control deprecation and author warnings

Refactor the -Wdev and -Wno-dev options parser to use a generic -W
parser that follows the GCC pattern, excluding support for
-Werror=TYPE and -Wno-error=TYPE formats for now.

Add 'deprecated' warning options type, to allow setting
CMAKE_WARN_DEPRECATED via the -W options.

Make author and deprecated warnings enabled by default.

Add tests for new options and updated documentation.
---
 Help/manual/OPTIONS_BUILD.txt |  17 +-
 Help/variable/CMAKE_WARN_DEPRECATED.rst   |   6 +-
 Source/cmMakefile.cxx |   8 +-
 Source/cmMakefile.h   |   3 +-
 Source/cmMessageCommand.cxx   |  12 +-
 Source/cmake.cxx  | 248 ++
 Source/cmake.h|  32 ++-
 Tests/RunCMake/CommandLine/RunCMakeTest.cmake |  37 +++-
 Tests/RunCMake/CommandLine/W_bad-arg1-result.txt  |   1 +
 Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt  |   2 +
 Tests/RunCMake/CommandLine/W_bad-arg2-result.txt  |   1 +
 Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt  |   2 +
 Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt |   4 +
 Tests/RunCMake/CommandLine/Wdeprecated.cmake  |   1 +
 Tests/RunCMake/CommandLine/Wdev-stderr.txt|   2 +-
 Tests/RunCMake/CommandLine/Wdev.cmake |   2 +-
 Tests/RunCMake/CommandLine/Wno-deprecated.cmake   |   1 +
 Tests/RunCMake/CommandLine/Wno-dev.cmake  |   2 +-
 Tests/RunCMake/message/RunCMakeTest.cmake |   1 +
 Tests/RunCMake/message/defaultmessage-result.txt  |   1 +
 Tests/RunCMake/message/defaultmessage-stderr.txt  |  11 +
 Tests/RunCMake/message/defaultmessage.cmake   |   4 +
 Tests/RunCMake/message/nomessage.cmake|  13 ++
 23 files changed, 345 insertions(+), 66 deletions(-)
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg1-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg2-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Wdeprecated.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Wno-deprecated.cmake
 create mode 100644 Tests/RunCMake/message/defaultmessage-result.txt
 create mode 100644 Tests/RunCMake/message/defaultmessage-stderr.txt
 create mode 100644 Tests/RunCMake/message/defaultmessage.cmake

diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt
index 4207db4..3b54f6c 100644
--- a/Help/manual/OPTIONS_BUILD.txt
+++ b/Help/manual/OPTIONS_BUILD.txt
@@ -77,10 +77,23 @@
  Suppress developer warnings.
 
  Suppress warnings that are meant for the author of the
- CMakeLists.txt files.
+ CMakeLists.txt files. By default this will also turn off
+ deprecation warnings.
 
 ``-Wdev``
  Enable developer warnings.
 
  Enable warnings that are meant for the author of the CMakeLists.txt
- files.
+ files. By default this will also turn on deprecation warnings.
+
+``-Wdeprecated``
+ Enable deprecated macro and function warnings.
+
+ Enable warnings for usage of deprecated macros and functions, that
+ are meant for the author of the CMakeLists.txt files.
+
+``-Wno-deprecated``
+ Suppress deprecated macro and function warnings.
+
+ Suppress warnings for usage of deprecated macros and functions, that
+ are meant for the author of the CMakeLists.txt files.
diff --git a/Help/variable/CMAKE_WARN_DEPRECATED.rst 
b/Help/variable/CMAKE_WARN_DEPRECATED.rst
index 662cbd8..5c8ce88 100644
--- a/Help/variable/CMAKE_WARN_DEPRECATED.rst
+++ b/Help/variable/CMAKE_WARN_DEPRECATED.rst
@@ -4,4 +4,8 @@ CMAKE_WARN_DEPRECATED
 Whether to issue deprecation warnings for macros and functions.
 
 If ``TRUE``, this can be used by macros and functions to issue deprecation
-warnings.  This variable is ``FALSE`` by default.
+warnings.  This variable is ``TRUE`` by default.
+
+These warnings can be enabled with the ``-Wdeprecated`` option, or
+disabled with the ``-Wno-deprecated`` option, when running
+:manual:`cmake(1)`.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index a1f143a..0eeb6ca 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -130,7 +130,8 @@ cmMakefile::~cmMakefile()
 
 //
 void cmMakefile::IssueMessage(cmake::MessageType t,
-  std::string const& text) const
+  std::string const& text,
+  

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

2015-11-02 Thread Brad King
On 11/01/2015 11:09 AM, Michael Scott wrote:
> I've attached a version of the patch

Thanks.

> without the conversion 
> functionality, for dev messages only, as the deprecated section wasn't 
> part of this patch. I've also not included rst files in the commit, as 
> it seems like a waste of time to revert them now and then change them 
> back to what they should be afterwards. In the find commit the rst files 
> will of course be in there.

We try to keep 'master' ready for release at any time so please include
the documentation updates as if this were the end of the development.

Also please don't leave any source infrastructure in place that is not
yet needed.  Currently it looks like there are some pieces in there to
prepare for the rest of the topic.  I still see ERROR_LEVEL, AUTHOR_ERROR,
etc.  That makes review harder because I do not know which parts are
needed now and which are meant for code I haven't seen yet.  The reason I
asked for a reduced initial patch is to avoid reviewing so much at once.
The changes should be presented as incremental commits.  Each should be
suitable as the end of the topic without following changes.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-11-01 Thread Michael Scott

The semantic challenges are in the warning=>error conversion so I'd like
to get the other parts reviewed and integrated first.
I've attached a version of the patch without the conversion 
functionality, for dev messages only, as the deprecated section wasn't 
part of this patch. I've also not included rst files in the commit, as 
it seems like a waste of time to revert them now and then change them 
back to what they should be afterwards. In the find commit the rst files 
will of course be in there.


One noticeable difference in this patch is the addition of an optional 
parameter to cmake::IssueMessage. This is intended to solve the future 
issue that the message command must support the setting the 
warning/error CMake variables in the CMake file itself, by changing the 
message type, whereas cmake::IssueMessage will only be checking the 
cache for the variables.


If there are any issues with this first chunk please let me know.

Cheers,
Michael
From 14ab5c6e0c46fc60ed9007fa06ce9b3c135e3150 Mon Sep 17 00:00:00 2001
From: Michael Scott 
Date: Sun, 1 Nov 2015 16:05:15 +
Subject: [PATCH] Add -W options to control deprecation and author warnings

Refactor the -Wdev and -Wno-dev options parser to use a generic -W
parser that follows the GCC pattern, excluding support for
-Werror=TYPE and -Wno-error=TYPE formats for now.

Add 'deprecated' warning options type, to allow setting
CMAKE_WARN_DEPRECATED via the -W options.

Add tests for new options.
---
 Source/cmMakefile.cxx |   8 +-
 Source/cmMakefile.h   |   3 +-
 Source/cmMessageCommand.cxx   |  12 +-
 Source/cmake.cxx  | 329 +++---
 Source/cmake.h|  34 ++-
 Tests/RunCMake/CommandLine/RunCMakeTest.cmake |  37 ++-
 Tests/RunCMake/CommandLine/W_bad-arg1-result.txt  |   1 +
 Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt  |   2 +
 Tests/RunCMake/CommandLine/W_bad-arg2-result.txt  |   1 +
 Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt  |   2 +
 Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt |   4 +
 Tests/RunCMake/CommandLine/Wdeprecated.cmake  |   1 +
 Tests/RunCMake/CommandLine/Wdev-stderr.txt|   2 +-
 Tests/RunCMake/CommandLine/Wdev.cmake |   2 +-
 Tests/RunCMake/CommandLine/Wno-deprecated.cmake   |   1 +
 Tests/RunCMake/CommandLine/Wno-dev.cmake  |   2 +-
 Tests/RunCMake/message/RunCMakeTest.cmake |   1 +
 Tests/RunCMake/message/defaultmessage-result.txt  |   1 +
 Tests/RunCMake/message/defaultmessage-stderr.txt  |  11 +
 Tests/RunCMake/message/defaultmessage.cmake   |   4 +
 Tests/RunCMake/message/nomessage.cmake|  13 +
 21 files changed, 407 insertions(+), 64 deletions(-)
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg1-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg2-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Wdeprecated.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Wno-deprecated.cmake
 create mode 100644 Tests/RunCMake/message/defaultmessage-result.txt
 create mode 100644 Tests/RunCMake/message/defaultmessage-stderr.txt
 create mode 100644 Tests/RunCMake/message/defaultmessage.cmake

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index a1f143a..0eeb6ca 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -130,7 +130,8 @@ cmMakefile::~cmMakefile()
 
 //
 void cmMakefile::IssueMessage(cmake::MessageType t,
-  std::string const& text) const
+  std::string const& text,
+  bool ignoreWarningLevels) const
 {
   // Collect context information.
   if(!this->ExecutionStatusStack.empty())
@@ -139,7 +140,8 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
   {
   this->ExecutionStatusStack.back()->SetNestedError(true);
   }
-this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace());
+this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace(),
+ignoreWarningLevels);
 }
   else
 {
@@ -154,7 +156,7 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
   lfc.FilePath = converter.Convert(lfc.FilePath, cmOutputConverter::HOME);
   }
 lfc.Line = 0;
-this->GetCMakeInstance()->IssueMessage(t, text, lfc);
+this->GetCMakeInstance()->IssueMessage(t, text, lfc, ignoreWarningLevels);
 }
 }
 
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 4215b72..878c13d 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -719,7 +719,8 @@ public:
   };
 
   void 

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

2015-10-28 Thread Brad King
On 10/27/2015 06:59 PM, Michael Scott wrote:
> They were part of the original patch a while ago, so I left them in when 
> I re-applied the proposed patch. Did you want to apply the changes piece 
> by piece, or just the review the changes piece by piece? I can tailor 
> the proposed patch(s) to suit either I imagine.

The semantic challenges are in the warning=>error conversion so I'd like
to get the other parts reviewed and integrated first.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-10-27 Thread Michael Scott

that appear to be related to warning=>error upgrade options.
Didn't we just decide to not tackle this part yet?


They were part of the original patch a while ago, so I left them in when 
I re-applied the proposed patch. Did you want to apply the changes piece 
by piece, or just the review the changes piece by piece? I can tailor 
the proposed patch(s) to suit either I imagine.


I realised that the patch has some somewhat conflicting changes in it, 
in that the cmMessageCommand code checks the Makefile for the variables, 
but the cmake code checks the cache. So when the user say turns on 
deprecated errors in the CMakeLists file, cmMessageCommand sets the 
messages as errors, but then the cmake code suppresses the message. So I 
need to fix that in the subsequent proposed patch(s). I was thinking of 
adding a boolean flag parameter to IssueMessage, default to false, to 
signal the method to not suppress messages based on the state of the 
CMake variables, but there's perhaps better ways to do this.


Cheers,
Michael
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-10-24 Thread Michael Scott

Hi Brad,


Let's work out the command line options for the existing
deprecation warning/error options first and then extend capabilities as
a second step.  It will be easier to review in smaller pieces anyway.

Okay no problem, I'll try and break the changes down into chunks for review.

I've made the first set of changes,  to reapply the series of previous 
changes for the -W options, along with some tweaks to improve the 
implementation and some additional tests for the changes. Let me know if 
there are any issues with the proposed changes. The changes in the patch 
for the Help files are the same as before, so they can probably be 
skimmed over to be honest, likewise the changes in cmMessageCommand are 
the same as before too.


The next stage would then be to add support for upgrading and 
downgrading warning and error messages depending on the state of the 
CMake variables, in the IssueMessage function, and update the callers of 
the function to check the error flag and take appropriate action.


Cheers,
Michael
From 8d7aae1411331b980bd5d7515e5f7326db5890cb Mon Sep 17 00:00:00 2001
From: Michael Scott 
Date: Fri, 23 Oct 2015 19:48:58 +0100
Subject: [PATCH] Add -W options to control deprecation and author warnings and
 errors

Refactor the -Wdev and -Wno-dev options parser to use a generic -W
parser that follows the GCC pattern, which includes support for
-Werror=TYPE and -Wno-error=TYPE formats.

Add 'deprecated' warning options type, to allow setting
CMAKE_ERROR_DEPRECATED and CMAKE_WARN_DEPRECATED via the -W options.

Add -Werror=dev and -Wno-error=dev options so that dev warning options
are in line with deprecated warning options. Use a new
CMAKE_SUPPRESS_DEVELOPER_ERRORS internal cache entry to store the above
new dev options persistently.

Add tests for new options and updated cmake documentation and release
notes to list new options.
---
 Help/manual/OPTIONS_BUILD.txt  |  43 ++-
 Help/release/dev/cmake-W-options.rst   |  13 +
 Help/variable/CMAKE_ERROR_DEPRECATED.rst   |   8 +-
 Help/variable/CMAKE_WARN_DEPRECATED.rst|   6 +-
 Source/cmMessageCommand.cxx|  14 +-
 Source/cmake.cxx   | 297 ++---
 Source/cmake.h |  27 +-
 Tests/RunCMake/CommandLine/RunCMakeTest.cmake  |  59 +++-
 Tests/RunCMake/CommandLine/W_bad-arg1-result.txt   |   1 +
 Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt   |   2 +
 Tests/RunCMake/CommandLine/W_bad-arg2-result.txt   |   1 +
 Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt   |   2 +
 Tests/RunCMake/CommandLine/W_bad-arg3-result.txt   |   1 +
 Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt   |   2 +
 Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt  |   4 +
 Tests/RunCMake/CommandLine/Wdeprecated.cmake   |   1 +
 Tests/RunCMake/CommandLine/Wdev-stderr.txt |   2 +-
 Tests/RunCMake/CommandLine/Wdev.cmake  |   2 +-
 .../CommandLine/Werror_deprecated-result.txt   |   1 +
 .../CommandLine/Werror_deprecated-stderr.txt   |   4 +
 Tests/RunCMake/CommandLine/Werror_deprecated.cmake |   1 +
 Tests/RunCMake/CommandLine/Werror_dev-result.txt   |   1 +
 Tests/RunCMake/CommandLine/Werror_dev-stderr.txt   |   5 +
 Tests/RunCMake/CommandLine/Werror_dev.cmake|   1 +
 Tests/RunCMake/CommandLine/Wno-deprecated.cmake|   1 +
 Tests/RunCMake/CommandLine/Wno-dev.cmake   |   2 +-
 .../CommandLine/Wno-error_deprecated.cmake |   2 +
 Tests/RunCMake/CommandLine/Wno-error_dev.cmake |   2 +
 28 files changed, 447 insertions(+), 58 deletions(-)
 create mode 100644 Help/release/dev/cmake-W-options.rst
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg1-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg2-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg3-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Wdeprecated.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Werror_deprecated-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Werror_deprecated.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Werror_dev-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/Werror_dev-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Werror_dev.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Wno-deprecated.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Wno-error_deprecated.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Wno-error_dev.cmake

diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt
index 

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

2015-10-22 Thread Brad King
On 10/21/2015 06:01 PM, Michael Scott wrote:
>> should defer this part until after the main warning control
>> command-line options are worked out.
> That sounds sensible, I'll make the proposed changes to the cmake and 
> cmMessageCommand classes first, get some adequate tests in and then move 
> on to updating the callers.

Oops; actually by "this part" I was referring to the entire warning->error
upgrade feature.  Let's work out the command line options for the existing
deprecation warning/error options first and then extend capabilities as
a second step.  It will be easier to review in smaller pieces anyway.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-10-21 Thread Michael Scott

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.

Okay that sounds good to me, makes the implementation simpler.


We just need to make sure the process exit code is changed.
If this is the case then just ensuring that IssueMessage sets the fatal 
error occurred flag, on a (upgraded or not) author or deprecated error 
as planned, may achieve this as it looks like cmake::Generate changes 
its return code if the error flag is set, but perhaps I'm mistaken or 
other code paths don't have this behaviour. So I probably wouldn't feel 
confident on relying on just setting the flag in IssueMessage.



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.
That sounds sensible, I'll make the proposed changes to the cmake and 
cmMessageCommand classes first, get some adequate tests in and then move 
on to updating the callers. I don't think it'll be a massive task to 
update the callers so I'm not particularly worried about that part, 
hopefully there won't be any surprises though.


I'm aiming to get a first patch proposal done by the end of this week.

Cheers,
Michael




--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-10-19 Thread Brad King
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

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-10-18 Thread Michael Scott

Hi Brad,

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?


I was thinking of ideas and one came to mind, how does the following sound?

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. 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.


Cheers,
Michael
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-09-25 Thread Michael Scott

I'm going to proceed with my reversion of the entire feature for 3.4.
We can pick this up during post-3.4 development when you have time.
Then we can review the all related semantics together.


Okay, that's fair enough, sorry it hasn't been possible to get it into 
the 3.4 release in time.


Cheers,
Michael
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-09-25 Thread Brad King
On 09/25/2015 04:12 PM, Brad King wrote:
> I'm going to proceed with my reversion of the entire feature for 3.4.
> We can pick this up during post-3.4 development when you have time.
> Then we can review the all related semantics together.

Reverted here:

 Revert topic 'cmake-W-options'
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=81739e92

Then I added your test case for the previously-regressed behavior:

 Tests: Add case for -Wdev and -Wno-dev with non-message() warnings
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bc3e1e4b

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-09-25 Thread Brad King
On 09/25/2015 03:44 PM, Michael Scott wrote:
> it's release period at my office too so a busy time there as well.

Okay, I really don't want to try to rush in a fix for this before the
3.4 deadline, especially when we're both busy with other things.  The
entire feature was developed under the misconception that -Wdev and
-Wno-dev were only about the message() command.  The tests only cover
that.  We've identified that there may be other IssueMessage calls that
may not deal well with -Werror=dev.

I'm going to proceed with my reversion of the entire feature for 3.4.
We can pick this up during post-3.4 development when you have time.
Then we can review the all related semantics together.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-09-25 Thread Michael Scott
Sorry I'm being a bit slow with this topic, it's release period at my 
office too :D so a busy time there as well.



The cmake::Configure check for that runs before the scripts run so
it is not possible to get script-provided values there.  Do you have
a check in a new context that occurs later?  If so please provide the
patch in progress and point out the problem.


The checks I'm adding in are in the cmake::PrintMessagePreamble method, 
I've included an initial version of the patch. This looks correct and 
seems to behave correctly when either the user uses the -W options, or 
doesn't change anything relating to warnings or errors. But, when the 
user sets the variables being checked for, in the CMake file itself, the 
checks don't pick up the set variables. I'm guessing because its only 
checking against the cache, and the normal usage of the set command 
doesn't set the variable in the cache?


This change causes the RunCMake.message and RunCMake.ObsoleteQtMacros 
tests for fail, as they do what is described just above.


Cheers,
Michael
From 9096cd7f2a0ff42db88c4adb25a403e75e381756 Mon Sep 17 00:00:00 2001
From: Michael Scott 
Date: Tue, 22 Sep 2015 22:43:24 +0100
Subject: [PATCH] Fix suppressing dev and deprecated messages via -W

Examine the dev and deprecated warning and error output variables when
printing message preambles, so that messages output outside of the
message command, via IssueMessage, are affected by the CMake '-W'
options again after the recent changes related to the -W options.
---
 Source/cmake.cxx   | 34 ++
 Tests/RunCMake/CommandLine/Wdev-stderr.txt |  6 ++
 Tests/RunCMake/CommandLine/Wdev.cmake  |  5 +
 Tests/RunCMake/CommandLine/Wno-dev.cmake   |  5 +
 4 files changed, 50 insertions(+)

diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index f069481..dec254f 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2591,18 +2591,52 @@ bool cmake::PrintMessagePreamble(cmake::MessageType t, 
std::ostream& msg)
   else if(t == cmake::DEPRECATION_ERROR)
 {
 msg << "CMake Deprecation Error";
+
+// if CMAKE_ERROR_DEPRECATED is on, show the message, otherwise suppress it
+const char* errorDeprecated = this->State->GetCacheEntryValue(
+"CMAKE_ERROR_DEPRECATED");
+if(cmSystemTools::IsOff(errorDeprecated))
+  {
+  return false;
+  }
 }
   else if (t == cmake::DEPRECATION_WARNING)
 {
 msg << "CMake Deprecation Warning";
+
+// if CMAKE_WARN_DEPRECATED is on, show the message, otherwise suppress it
+const char* warnDeprecated = this->State->GetInitializedCacheValue(
+"CMAKE_WARN_DEPRECATED");
+if(cmSystemTools::IsOff(warnDeprecated))
+  {
+  return false;
+  }
 }
   else if (t == cmake::AUTHOR_WARNING)
 {
 msg << "CMake Warning (dev)";
+
+// if CMAKE_SUPPRESS_DEVELOPER_WARNINGS is on, suppress the message,
+// otherwise show it
+const char* suppress = this->State->GetCacheEntryValue(
+  "CMAKE_SUPPRESS_DEVELOPER_WARNINGS");
+if(cmSystemTools::IsOn(suppress))
+  {
+  return false;
+  }
 }
   else if (t == cmake::AUTHOR_ERROR)
 {
 msg << "CMake Error (dev)";
+
+// if CMAKE_ERROR_DEVELOPER_WARNINGS is on, show the message, otherwise
+// suppress it
+const char* devErrors = this->State->GetCacheEntryValue(
+  "CMAKE_ERROR_DEVELOPER_WARNINGS");
+if(cmSystemTools::IsOff(devErrors))
+  {
+  return false;
+  }
 }
   else
 {
diff --git a/Tests/RunCMake/CommandLine/Wdev-stderr.txt 
b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
index f427303..92c1d23 100644
--- a/Tests/RunCMake/CommandLine/Wdev-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
@@ -2,4 +2,10 @@
   Some Author Warning
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
+This warning is for project developers.  Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at Wdev.cmake:6 \(include\):
+  include\(\) given empty file name \(ignored\).
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CommandLine/Wdev.cmake 
b/Tests/RunCMake/CommandLine/Wdev.cmake
index 0242086..9d2439b 100644
--- a/Tests/RunCMake/CommandLine/Wdev.cmake
+++ b/Tests/RunCMake/CommandLine/Wdev.cmake
@@ -1 +1,6 @@
 message(AUTHOR_WARNING "Some Author Warning")
+
+# with -Wdev this will also cause an AUTHOR_WARNING message, checks that
+# messages issued outside of the message command, by other CMake commands, also
+# are affected by -Wdev
+include("")
\ No newline at end of file
diff --git a/Tests/RunCMake/CommandLine/Wno-dev.cmake 
b/Tests/RunCMake/CommandLine/Wno-dev.cmake
index 0242086..05dcc1e 100644

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

2015-09-25 Thread Brad King
On 09/24/2015 05:45 PM, Michael Scott wrote:
> I've created a fix for the issue of -Wno-dev and -Wno-deprecated options 
> not being honoured, and extended the tests to cover this additional 
> scenario.

Thanks for working on it.

> However I'm having an issue with determining if variables are set in 
> cmake.cxx. The initial fix checked for the variables using the 
> "GetCacheEntryValue" method in cmState, but I found that this didn't 
> work when the variable (say CMAKE_WARN_DEPRECATED) was set in a .cmake 
> file, as is the case for the "RunCMake/message/warnmessage.cmake".

The cmake::Configure check for that runs before the scripts run so
it is not possible to get script-provided values there.  Do you have
a check in a new context that occurs later?  If so please provide the
patch in progress and point out the problem.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-09-24 Thread Brad King
On 09/22/2015 08:53 AM, Brad King wrote:
> In this case we have a bug in a new feature that was
> introduced in post-3.3 development so we need to either fix it or
> remove the offending parts of the new features before Oct 1 for 3.4.

In preparation for the 3.4 freeze I've added a topic to revert
the entire change:

 Revert topic 'cmake-W-options' (#15747)
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=81739e92

Currently it is in 'next' for testing.  I will merge to 'master'
before 3.4 if the regression cannot otherwise be fixed by then.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-09-24 Thread Michael Scott
I've created a fix for the issue of -Wno-dev and -Wno-deprecated options 
not being honoured, and extended the tests to cover this additional 
scenario.


However I'm having an issue with determining if variables are set in 
cmake.cxx. The initial fix checked for the variables using the 
"GetCacheEntryValue" method in cmState, but I found that this didn't 
work when the variable (say CMAKE_WARN_DEPRECATED) was set in a .cmake 
file, as is the case for the "RunCMake/message/warnmessage.cmake". I 
toyed around with trying to get a hold of a cmMakefile instance and 
check the state of the variable via that, by getting the first object of 
the global generator makefiles, but this didn't always seem to work. 
Would you be able to advise on what the correct way is to get the 
current value of a variable, in the cmake class? I feel like I'm missing 
something simple here, as I'm still not too familiar with the code.


Cheers,
Michael
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-09-22 Thread Brad King
On 09/21/2015 05:51 PM, Michael Scott wrote:
> Yes the -Werr-dev, -Wno-err-dev, -Werr-deprectated and 
> -Wno-err-deprecated may be trickier than expected to get behaving as 
> intended. I'll try and get a better idea of the users of IssueMessage 
> and see if some ideas come to mind. Removing them would be fair enough 
> at this point, better to not include them than to include broken 
> functionality I'm sure. Do new features, such as -Werr-dev, have to be 
> sent by October 1st is it?

Oct 1 is the feature freeze in 'master' for CMake 3.4, though the
scale/scope of new features should be going down as we approach
that date.  In this case we have a bug in a new feature that was
introduced in post-3.3 development so we need to either fix it or
remove the offending parts of the new features before Oct 1 for 3.4.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-09-21 Thread Brad King
On 09/19/2015 06:32 PM, Michael Scott wrote:
> whether the -W options are intended to only be applicable
> for the message command (and so the current behaviour is correct),
> or whether they should affect all author and deprecated messages
> output by other parts of CMake?

The -Wdev/-Wno-dev options have always been for all messages
output by any part of CMake.  This needs to be preserved/corrected.

> If the current behaviour isn't correct, then one thing to have a
> good think about, is how to handle turning warnings into errors
> when -Werr-dev or -Werr-deprecated (and also the required behaviour
> when -Wno- is used). As some users of IssueMessage do different
> things if an error occurs (and is output), *after* IssueMessage
> is called. So there might need to be a way to signal to the caller
> when a warning has been upgraded to an error because of the users
> options perhaps?

Likely yes.  This may require sweeping changes to address.  We're
too close to the freeze for 3.4 to do this now.  Perhaps we should
simply remove -Werr-dev for now.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-09-21 Thread Michael Scott

The -Wdev/-Wno-dev options have always been for all messages
output by any part of CMake.  This needs to be preserved/corrected.
Okay, I've fixed the change to cmake::PrintMessagePreamble, so that 
it'll stop warning or error dev or deprecated messages getting printed 
out when the relevant CMake variables have been set. I just need to add 
some more test cases to cover this and I'll submit a patch.



Likely yes.  This may require sweeping changes to address.  We're
too close to the freeze for 3.4 to do this now.  Perhaps we should
simply remove -Werr-dev for now.


Yes the -Werr-dev, -Wno-err-dev, -Werr-deprectated and 
-Wno-err-deprecated may be trickier than expected to get behaving as 
intended. I'll try and get a better idea of the users of IssueMessage 
and see if some ideas come to mind. Removing them would be fair enough 
at this point, better to not include them than to include broken 
functionality I'm sure. Do new features, such as -Werr-dev, have to be 
sent by October 1st is it?


Cheers,
Michael

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-09-19 Thread Michael Scott
Investigating the issue a bit more, I can see why it's happening for the 
given example. When I made those changes, I only modified the "message" 
CMake command, to check the CMAKE_WARN/ERROR_DEPRECATED and 
CMAKE_SUPPRESS_DEVELOPER_WARNINGS variables before outputting the 
message. The message command uses cmake::IssueMessage to actually output 
the required message. What I wasn't aware of was that other commands and 
code also use the IssueMessage for outputting author and deprecated 
messages. As the IssueMessage command doesn't check those variables, or 
the new warning levels map, before outputting the message, that's why 
we're seeing this behaviour.


What I wanted to check before coming up with a fix, is whether the -W 
options are intended to only be applicable for the message command (and 
so the current behaviour is correct), or whether they should affect all 
author and deprecated messages output by other parts of CMake?


If the current behaviour isn't correct, then one thing to have a good 
think about, is how to handle turning warnings into errors when 
-Werr-dev or -Werr-deprecated (and also the required behaviour when 
-Wno- is used). As some users of IssueMessage do different things if an 
error occurs (and is output), *after* IssueMessage is called. So there 
might need to be a way to signal to the caller when a warning has been 
upgraded to an error because of the users options perhaps?


Cheers,
Michael
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

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

2015-09-17 Thread Brad King
On 07/29/2015 09:26 AM, Brad King wrote:
>  cmake: Add -W options to control deprecation warnings and errors
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c96fe0b4

This caused a regression:

 -Wno-dev doesn't work any more in CMake 3.4
 http://www.cmake.org/Bug/view.php?id=15747

Please take a look to fix it and extend the test suite accordingly.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-09-17 Thread Michael Scott

On 17/09/2015 13:49, Brad King wrote:

This caused a regression:

  -Wno-dev doesn't work any more in CMake 3.4
  http://www.cmake.org/Bug/view.php?id=15747

Please take a look to fix it and extend the test suite accordingly.

Thanks,
-Brad


Ah okay, I've replicated it on my Linux development environment, so I'll 
try and have a look over the weekend and find out what's going on.


Cheers,
Michael
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-08-03 Thread Brad King
On 08/03/2015 09:43 AM, Domen Vrankar wrote:
 Since CPack only gets CPACK_* variables from CMake we can't use
 CMAKE_SUPPRESS_DEVELOPER_ERRORS to revert back to warnings.

The mistake is that message() now treats warnings as errors
unless explicitly suppressed.  While normal CMake runs suppress
it by default, script mode and CPack have no such initialization.
I've inverted the logic to require the mode to be explicitly enabled:

 cmake: Do not treat developer warnings as errors by default in scripts
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=975426ce

That should fix the test failures.

On 08/01/2015 04:03 AM, Stephen Kelly wrote:
 I still think it's a bit odd that policies and message(DEPRECATED) use a
 different semantic though (ie, message(DEPRECATED) should issue a warning by
 default unless -Wno-dev is used).

...or -Wno-deprecated

That semantic change may be reasonable but is independent of the command
line options change under discussion here.  It may require a policy too.

-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-08-03 Thread Stephen Kelly
Brad King wrote:

 On 08/01/2015 04:03 AM, Stephen Kelly wrote:
 I still think it's a bit odd that policies and message(DEPRECATED) use a
 different semantic though (ie, message(DEPRECATED) should issue a warning
 by default unless -Wno-dev is used).
 
 ...or -Wno-deprecated
 
 That semantic change may be reasonable but is independent of the command
 line options change under discussion here.  It may require a policy too.

I filed a bug to track this:

 http://www.cmake.org/Bug/view.php?id=15677

Thanks,

Steve.


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-08-03 Thread Domen Vrankar
 The branch seems to make the RunCMake.CPack_RPM test fail on my machine. I
 have not investigated.

Missed this thread... I was talking to Brad about this.
Failing test is written exactly for testing author warning message
(CPackRPM.cmake:560). RPM packages may be relocatable but if
relocation paths don't match with any file paths in package an author
warning is output but package is still created.

Since CPack only gets CPACK_* variables from CMake we can't use
CMAKE_SUPPRESS_DEVELOPER_ERRORS to revert back to warnings. If this is
the only location where CPack uses developer messages we could change
it to normal info message but implementing this fallback mechanism for
CPack (and CTest?) would probably be a more complete solution.

Regards,
Domen
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-08-01 Thread Stephen Kelly
Brad King wrote:

 On 07/27/2015 07:07 PM, Michael Scott wrote:
 I've changed the -W dev options to affect the deprecated warnings/errors
 as well, but only if the user hasn't used one of the options that
 control deprecated warnings (-Wdeprecated, -Wno-deprecated,
 -Werror=deprecated, -Wno-error=deprecated), if they have then the -W dev
 options won't affect the CMAKE_WARN_DEPRECATED or CMAKE_ERROR_DEPRECATED
 variables.
 
 I've also added the two -W dev options, -Werror=dev and
 -Wno-error=dev, to bring this set of options in line with the
 deprecated set of options.

Thanks for working on this. Sorry it was not as straightforward as I had 
suggested at the start! 

I still think it's a bit odd that policies and message(DEPRECATED) use a 
different semantic though (ie, message(DEPRECATED) should issue a warning by 
default unless -Wno-dev is used).

The branch seems to make the RunCMake.CPack_RPM test fail on my machine. I 
have not investigated.

Thanks,

Steve.




Guessing configuration NoConfig
Start 386: RunCMake.CPack_RPM
1/1 Test #386: RunCMake.CPack_RPM ...***Failed0.69 sec
-- RPM/MINIMAL - PASSED
CMake Error at /home/stephen/dev/src/cmake-
master/Tests/RunCMake/RunCMake.cmake:129 (message):
  RPM/PARTIALLY_RELOCATABLE_WARNING - FAILED:

  Result is [1], not [0].

  Command was:

   command /home/stephen/dev/src/cmake-master-build2/bin/cmake -
DRunCMake_TEST=PARTIALLY_RELOCATABLE_WARNING -DGENERATOR_TYPE=RPM -
Dsrc_dir=/home/stephen/dev/src/cmake-master/Tests/RunCMake/CPack -
Dbin_dir=/home/stephen/dev/src/cmake-master-
build2/Tests/RunCMake/RPM/CPack/PARTIALLY_RELOCATABLE_WARNING-build -
Dconfig_file=/home/stephen/dev/src/cmake-master-
build2/Tests/RunCMake/CPack/conf/RPM_config.cmake -P 
/home/stephen/dev/src/cmake-master/Tests/RunCMake/CPack/VerifyResult.cmake

  Actual stdout:

   actual-out 

  Actual stderr:

   actual-err CMake Error at /home/stephen/dev/src/cmake-
master/Tests/RunCMake/CPack/VerifyResult.cmake:36 (message):
   actual-err   Found more than one file for file No.  '1'! Found files 
count '0'.  Files:
   actual-err   ''
   actual-err 
   actual-err   CPack output: 'CPack: Create package using RPM
   actual-err 
   actual-err   CPack: Install projects
   actual-err 
   actual-err   CPack: - Run preinstall target for: 
PARTIALLY_RELOCATABLE_WARNING
   actual-err 
   actual-err   CPack: - Install project: PARTIALLY_RELOCATABLE_WARNING
   actual-err 
   actual-err   CPack: Create package
   actual-err 
   actual-err   '
   actual-err 
   actual-err   CPack error: 'CMake Error (dev) at
   actual-err   /home/stephen/dev/src/cmake-
master/Modules/CPackRPM.cmake:560 (message):
   actual-err 
   actual-err CPackRPM:Warning: Path /not_relocatable/CMakeLists.txt is 
not on one of the
   actual-err relocatable paths! Package will be partially relocatable.
   actual-err 
   actual-err   Call Stack (most recent call first):
   actual-err 
   actual-err /home/stephen/dev/src/cmake-
master/Modules/CPackRPM.cmake:1209 (cpack_rpm_prepare_relocation_paths)
   actual-err /home/stephen/dev/src/cmake-
master/Modules/CPackRPM.cmake:1697 (cpack_rpm_generate_package)
   actual-err 
   actual-err 
   actual-err   This error is for project developers.  Use -Wno-error=dev 
to suppress it.
   actual-err 
   actual-err   
   actual-err 
   actual-err   CPack Error: Error while execution CPackRPM.cmake
   actual-err 
   actual-err   CPack Error: Problem compressing the directory
   actual-err 
   actual-err   CPack Error: Error when generating package: 
PARTIALLY_RELOCATABLE_WARNING
   actual-err 
   actual-err   ';
   actual-err 
   actual-err   config file: 'set(RPM_EXECUTABLE /usr/bin/rpm)
   actual-err 
   actual-err   set(RPMBUILD_EXECUTABLE /usr/bin/rpmbuild)'

Call Stack (most recent call first):
  /home/stephen/dev/src/cmake-master/Tests/RunCMake/RunCMake.cmake:143 
(run_cmake)
  /home/stephen/dev/src/cmake-
master/Tests/RunCMake/CPack/CPackTestHelpers.cmake:65 (run_cmake_command)
  /home/stephen/dev/src/cmake-
master/Tests/RunCMake/CPack/RunCMakeTest.cmake:8 (run_cpack_test)
  




0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.79 sec

The following tests FAILED:
386 - RunCMake.CPack_RPM (Failed)
Errors while running CTest


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-07-29 Thread Brad King
On 07/27/2015 07:07 PM, Michael Scott wrote:
 I've changed the -W dev options to affect the deprecated warnings/errors 
 as well, but only if the user hasn't used one of the options that 
 control deprecated warnings (-Wdeprecated, -Wno-deprecated, 
 -Werror=deprecated, -Wno-error=deprecated), if they have then the -W dev 
 options won't affect the CMAKE_WARN_DEPRECATED or CMAKE_ERROR_DEPRECATED 
 variables.
 
 I've also added the two -W dev options, -Werror=dev and 
 -Wno-error=dev, to bring this set of options in line with the 
 deprecated set of options.

Great!  I've applied the patch with a few tweaks:

 cmake: Add -W options to control deprecation warnings and errors
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c96fe0b4

The largest change is that I hid CMAKE_SUPPRESS_DEVELOPER_ERRORS
from public documentation since it is just an implementation
detail to store the corresponding options persistently.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-07-17 Thread Brad King
On 07/15/2015 05:08 PM, Michael Scott wrote:
 Looking at the cmMessageCommand::InitialPass and 
 cmake::PrintMessagePreamble code, if we want to mirror the deprecation 
 message behaviour, I'm tempted to suggest we also modify the message 
 mode AUTHOR_WARNING to be AUTHOR instead. It would make the mode 
 clearer on it's new behaviour and allow the code to be more consistent 
 with regards to dev and deprecated.
 
 I imagine this might be a big user affecting change though, so it might 
 be better to not do that and just make AUTHOR_WARNING cause fatal error 
 messages depending on the state of the associated cmake variables. What 
 are your thoughts on this?

I think the name AUTHOR_WARNING is fine even after these changes
because the new options explicitly request to make these warnings
into errors.  C++ compiler #pragma warn-like options are spelled
warn but can still be errors with the right options.

 P.S. Sorry my previous email broke the message threading, I'm replying 
 in a different way this time but please let me know if I'm still 
 breaking the message threading.

It still breaks the threading.  Your first few responses
(e.g. on 2015-06-24) were threaded correctly.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-07-15 Thread Michael Scott
Looking at the cmMessageCommand::InitialPass and 
cmake::PrintMessagePreamble code, if we want to mirror the deprecation 
message behaviour, I'm tempted to suggest we also modify the message 
mode AUTHOR_WARNING to be AUTHOR instead. It would make the mode 
clearer on it's new behaviour and allow the code to be more consistent 
with regards to dev and deprecated.


I imagine this might be a big user affecting change though, so it might 
be better to not do that and just make AUTHOR_WARNING cause fatal error 
messages depending on the state of the associated cmake variables. What 
are your thoughts on this?


P.S. Sorry my previous email broke the message threading, I'm replying 
in a different way this time but please let me know if I'm still 
breaking the message threading.


Cheers,
Michael
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-07-08 Thread Michael Scott

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.


Making dev influence deprecation variables is not a problem. To support 
-Werror=dev we'll need a new variable I'm thinking though, something 
like a boolean CMAKE_SUPPRESS_DEVELOPER_ERRORS?


What should be the expected behaviour when combining dev and deprecated 
now, as they affect each other. If for example the user used the options 
-Wno-deprecated -Wdev in a cmake invocation, the most logical to me 
would be that this causes CMAKE_SUPPRESS_DEVELOPER_WARNINGS to be TRUE 
and CMAKE_WARN_DEPRECATED to be FALSE, but implementing that might make 
the code more complicated than I'd hoped.


Cheers,
Michael

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-07-06 Thread Brad King
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
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-07-02 Thread Michael Scott

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 example there is -Wdev 
and -Wno-dev, but not -Werror=dev or -Wno-error=dev). 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?

Cheers,
Michael

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-07-02 Thread Michael Scott
Sorry, I've added in the missing method to cmake.cxx, which updates the 
WarningLevel map according to the boolean provided. cmake-gui compiles 
without errors again.


I could add support for the new options to the GUI, in which case I 
would probably also go back to the changes I made to cmake.cxx and make 
the code related to WarningLevel a bit more generic and replace 
instances of dev and deprecated with constants to make the changes a 
bit more maintainable.


Cheers,
Michael

On 25/06/2015 15:50, Brad King wrote:

On 06/24/2015 05:30 PM, Michael Scott wrote:

Thanks for the comments, here is the previous patch, with the suggested
amendments.

Thanks.

This hunk:


-  void SetSuppressDevWarnings(bool v)
-{
-  this-SuppressDevWarnings = v;
-  this-DoSuppressDevWarnings = true;
-}

causes the cmake-gui Qt dialog to fail to compile:

  $ git grep SetSuppressDevWarnings
  Source/QtDialog/QCMake.cxx:  
this-CMakeInstance-SetSuppressDevWarnings(this-SuppressDevWarnings);

Sorry I didn't notice that last time.

Please enable the BUILD_QtDialog option at CMake build time to
build this part and make sure it compiles after the changes.
It would be nice to also provide settings in cmake-gui for
these deprecation levels (as there is for -Wdev), but I won't
make that a requirement for acceptance of the patch.

Thanks,
-Brad



From c19b143756a9ecf800ac42a37dd2d4bac64d7025 Mon Sep 17 00:00:00 2001
From: Michael Scott michael.scott...@gmail.com
Date: Sat, 13 Jun 2015 18:34:31 +0100
Subject: [PATCH] Refactored the -Wdev and -Wno-dev to use a generic -W parser,
 which follows the GCC pattern. Included support for setting
 CMAKE_ERROR_DEPRECATED and CMAKE_WARN_DEPRECATED via the deprecated warning.
 Added tests for new options and updated cmake documentation and release notes
 to list new options.

---
 Help/manual/OPTIONS_BUILD.txt  |  24 
 Help/release/dev/cmake-Wdeprecated.rst |   9 ++
 Help/variable/CMAKE_ERROR_DEPRECATED.rst   |   4 +
 Help/variable/CMAKE_WARN_DEPRECATED.rst|   4 +
 Source/cmake.cxx   | 127 ++---
 Source/cmake.h |  24 ++--
 Tests/RunCMake/CommandLine/RunCMakeTest.cmake  |  37 ++
 Tests/RunCMake/CommandLine/W_bad-arg1-result.txt   |   1 +
 Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt   |   2 +
 Tests/RunCMake/CommandLine/W_bad-arg2-result.txt   |   1 +
 Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt   |   2 +
 Tests/RunCMake/CommandLine/W_bad-arg3-result.txt   |   1 +
 Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt   |   2 +
 Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt  |   4 +
 Tests/RunCMake/CommandLine/Wdeprecated.cmake   |   1 +
 .../CommandLine/Werror_deprecated-result.txt   |   1 +
 .../CommandLine/Werror_deprecated-stderr.txt   |   4 +
 Tests/RunCMake/CommandLine/Werror_deprecated.cmake |   1 +
 Tests/RunCMake/CommandLine/Wno-deprecated.cmake|   1 +
 .../CommandLine/Wno-error_deprecated.cmake |   1 +
 20 files changed, 223 insertions(+), 28 deletions(-)
 create mode 100644 Help/release/dev/cmake-Wdeprecated.rst
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg1-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg2-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg3-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Wdeprecated.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Werror_deprecated-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Werror_deprecated.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Wno-deprecated.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Wno-error_deprecated.cmake

diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt
index 4207db4..5366cae 100644
--- a/Help/manual/OPTIONS_BUILD.txt
+++ b/Help/manual/OPTIONS_BUILD.txt
@@ -84,3 +84,27 @@
 
  Enable warnings that are meant for the author of the CMakeLists.txt
  files.
+
+``-Wdeprecated``
+ Enable deprecated macro and function warnings.
+
+ Enable warnings for usage of deprecated macros and functions, that are meant 
+ for the author of the CMakeLists.txt files. 
+
+``-Wno-deprecated``
+ Suppress deprecated macro and function warnings.
+ 
+ Suppress warnings for usage of deprecated macros and functions, that are 
meant 
+ for the author of the CMakeLists.txt files. 
+
+``-Werror=deprecated``
+ Make deprecated macro and function warnings errors.
+
+ Make warnings for usage of deprecated macros and functions, that are meant 
+ for the author of the CMakeLists.txt files, errors. 
+

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

2015-06-30 Thread Stephen Kelly
Michael Scott wrote:

 Thanks for the comments, here is the previous patch, with the suggested
 amendments.

Thanks for working on this.

I'm wondering how these new command line options relate to the existing 
options -Wdev and -Wno-dev. Is there any reason not to make those existing 
options set the CMAKE_WARN_DEPRECATED variable? 

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? 

If the new options are merged to master should -Wdev and -Wno-dev also be 
changed to affect CMAKE_WARN_DEPRECATED?

Thanks,

Steve.


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-06-25 Thread Brad King
On 06/24/2015 05:30 PM, Michael Scott wrote:
 Thanks for the comments, here is the previous patch, with the suggested 
 amendments.

Thanks.

This hunk:

 -  void SetSuppressDevWarnings(bool v)
 -{
 -  this-SuppressDevWarnings = v;
 -  this-DoSuppressDevWarnings = true;
 -}

causes the cmake-gui Qt dialog to fail to compile:

 $ git grep SetSuppressDevWarnings
 Source/QtDialog/QCMake.cxx:  
this-CMakeInstance-SetSuppressDevWarnings(this-SuppressDevWarnings);

Sorry I didn't notice that last time.

Please enable the BUILD_QtDialog option at CMake build time to
build this part and make sure it compiles after the changes.
It would be nice to also provide settings in cmake-gui for
these deprecation levels (as there is for -Wdev), but I won't
make that a requirement for acceptance of the patch.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-06-24 Thread Michael Scott
Thanks for the comments, here is the previous patch, with the suggested 
amendments.


Cheers,
Michael

On 24/06/2015 15:45, Brad King wrote:

On 06/23/2015 03:57 PM, Michael Scott wrote:

I've implemented some changes to cmake.cxx and cmake.h, to implement
setting the CMAKE_ERROR_DEPRECATED and CMAKE_WARN_DEPRECATED variables
via command line options, for the Mantis issue 0014669, in a generic GCC
style pattern. I've taken on board the previous suggestions, including
adding tests for the new options and updating the cmake application
options documentation. I've attached the proposed patch to this email,
please let me know if there are any incorrect changes in the patch.

Thanks.  Here are some comments:

* Please update the Help/variable/CMAKE_*_DEPRECATED.rst documents
   to mention the appropriate command-line options, perhaps with
   a :manual:`cmake(1)` link.

* Please add a Help/release/dev/cmake-Wdeprecated.rst file with
   a release note mentioning the options.

* Please ensure all sources added/modified by the patch have
   a newline on the last line (but not a trailing blank line).

Thanks,
-Brad



From a588e904c414270c78465b6423c89ece52801fbd Mon Sep 17 00:00:00 2001
From: Michael Scott michael.scott...@gmail.com
Date: Sat, 13 Jun 2015 18:34:31 +0100
Subject: [PATCH] Refactored the -Wdev and -Wno-dev to use a generic -W parser,
 which follows the GCC pattern. Included support for setting
 CMAKE_ERROR_DEPRECATED and CMAKE_WARN_DEPRECATED via the deprecated warning.
 Added tests for new options and updated cmake documentation and release notes
 to list new options.

---
 Help/manual/OPTIONS_BUILD.txt  |  24 +
 Help/release/dev/cmake-Wdeprecated.rst |   9 ++
 Help/variable/CMAKE_ERROR_DEPRECATED.rst   |   4 +
 Help/variable/CMAKE_WARN_DEPRECATED.rst|   4 +
 Source/cmake.cxx   | 112 +
 Source/cmake.h |  23 +++--
 Tests/RunCMake/CommandLine/RunCMakeTest.cmake  |  37 +++
 Tests/RunCMake/CommandLine/W_bad-arg1-result.txt   |   1 +
 Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt   |   2 +
 Tests/RunCMake/CommandLine/W_bad-arg2-result.txt   |   1 +
 Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt   |   2 +
 Tests/RunCMake/CommandLine/W_bad-arg3-result.txt   |   1 +
 Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt   |   2 +
 Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt  |   4 +
 Tests/RunCMake/CommandLine/Wdeprecated.cmake   |   1 +
 .../CommandLine/Werror_deprecated-result.txt   |   1 +
 .../CommandLine/Werror_deprecated-stderr.txt   |   4 +
 Tests/RunCMake/CommandLine/Werror_deprecated.cmake |   1 +
 Tests/RunCMake/CommandLine/Wno-deprecated.cmake|   1 +
 .../CommandLine/Wno-error_deprecated.cmake |   1 +
 20 files changed, 207 insertions(+), 28 deletions(-)
 create mode 100644 Help/release/dev/cmake-Wdeprecated.rst
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg1-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg2-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg3-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Wdeprecated.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Werror_deprecated-result.txt
 create mode 100644 Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt
 create mode 100644 Tests/RunCMake/CommandLine/Werror_deprecated.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Wno-deprecated.cmake
 create mode 100644 Tests/RunCMake/CommandLine/Wno-error_deprecated.cmake

diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt
index 4207db4..5366cae 100644
--- a/Help/manual/OPTIONS_BUILD.txt
+++ b/Help/manual/OPTIONS_BUILD.txt
@@ -84,3 +84,27 @@
 
  Enable warnings that are meant for the author of the CMakeLists.txt
  files.
+
+``-Wdeprecated``
+ Enable deprecated macro and function warnings.
+
+ Enable warnings for usage of deprecated macros and functions, that are meant 
+ for the author of the CMakeLists.txt files. 
+
+``-Wno-deprecated``
+ Suppress deprecated macro and function warnings.
+ 
+ Suppress warnings for usage of deprecated macros and functions, that are 
meant 
+ for the author of the CMakeLists.txt files. 
+
+``-Werror=deprecated``
+ Make deprecated macro and function warnings errors.
+
+ Make warnings for usage of deprecated macros and functions, that are meant 
+ for the author of the CMakeLists.txt files, errors. 
+
+``-Wno-error=deprecated``
+ Make deprecated macro and function warnings not errors.
+ 
+ Make warnings for usage of deprecated macros and functions, that are meant 
+ for the author of the CMakeLists.txt files, not errors.
diff 

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

2015-06-24 Thread Brad King
On 06/23/2015 03:57 PM, Michael Scott wrote:
 I've implemented some changes to cmake.cxx and cmake.h, to implement 
 setting the CMAKE_ERROR_DEPRECATED and CMAKE_WARN_DEPRECATED variables 
 via command line options, for the Mantis issue 0014669, in a generic GCC 
 style pattern. I've taken on board the previous suggestions, including 
 adding tests for the new options and updating the cmake application 
 options documentation. I've attached the proposed patch to this email, 
 please let me know if there are any incorrect changes in the patch.

Thanks.  Here are some comments:

* Please update the Help/variable/CMAKE_*_DEPRECATED.rst documents
  to mention the appropriate command-line options, perhaps with
  a :manual:`cmake(1)` link.

* Please add a Help/release/dev/cmake-Wdeprecated.rst file with
  a release note mentioning the options.

* Please ensure all sources added/modified by the patch have
  a newline on the last line (but not a trailing blank line).

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-06-23 Thread Brad King
On 06/22/2015 03:56 PM, Michael Scott wrote:
 the actual and expected values are identical. Why would this happen?

The expected value file is actually a regular expression that must
match the actual value.  This allows it to tolerate path differences
and other minor variations in the actual output.  Any regex meta-chars
need to be escaped in the -stderr.txt file.  Take a look at the code
in Tests/RunCMake/RunCMake.cmake to see the transformations done.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


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

2015-06-22 Thread Michael Scott

Hi Brad,

Apologies for taking a little while with this. I've addressed those 
points and added all the tests I think are appropriate for this, however 
when I run one of them it fails because stderr is not as expected, but 
the actual and expected values are identical. Why would this happen?


Test I'm running:

/run_cmake_command(W_bad-arg1 ${CMAKE_COMMAND} -W)/

Output from running the test:

/  W_bad-arg1 - FAILED://
//
//  stderr does not match that expected.//
//
//  Command was://
//
//   command /home/mike/Documents/cmake/src/cmake/bin/cmake -W//
//
//  Actual stdout://
//
//   actual-out //
//
//  Expected stderr to match://
//
//   expect-err CMake Error: -W must be followed with 
[no-][error=]name.//

//   expect-err CMake Error: Problem processing arguments. Aborting.//
//
//  Actual stderr://
//
//   actual-err CMake Error: -W must be followed with 
[no-][error=]name.//

//   actual-err CMake Error: Problem processing arguments. Aborting./

Cheers,
Michael

On 15/06/2015 15:06, Brad King wrote:

On 06/13/2015 01:41 PM, Michael Scott wrote:

I've implemented some changes to cmake.cxx and cmake.h, to implement
setting the CMAKE_ERROR_DEPRECATED and CMAKE_WARN_DEPRECATED variables
via command line options, for the Mantis issue 0014669, in a generic GCC
style pattern. I've attached the proposed patch to this email, does this
look like a sensible implementation?

Thanks for working on this.  Here are some comments:

* Please use 2 spaces and no tabs for indentation.

* Please extend Tests/RunCMake/CommandLine to cover this or find
   another appropriate test to update.  All options need coverage,
   including the error cases.

* The cmHasLiteralPrefix helper function may be useful in place
   of x.find(...) == 0.

Thanks,
-Brad



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

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

2015-06-15 Thread Brad King
On 06/13/2015 01:41 PM, Michael Scott wrote:
 I've implemented some changes to cmake.cxx and cmake.h, to implement 
 setting the CMAKE_ERROR_DEPRECATED and CMAKE_WARN_DEPRECATED variables 
 via command line options, for the Mantis issue 0014669, in a generic GCC 
 style pattern. I've attached the proposed patch to this email, does this 
 look like a sensible implementation?

Thanks for working on this.  Here are some comments:

* Please use 2 spaces and no tabs for indentation.

* Please extend Tests/RunCMake/CommandLine to cover this or find
  another appropriate test to update.  All options need coverage,
  including the error cases.

* The cmHasLiteralPrefix helper function may be useful in place
  of x.find(...) == 0.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers