diff options
author | Brad King <brad.king@kitware.com> | 2013-10-09 14:24:16 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-10-09 14:24:16 (GMT) |
commit | be9d289fcef487753a5c88268e9ed4262e39633b (patch) | |
tree | 40564b3e417c7fdea74b69dae5f6c99e3c2aad3c /Source | |
parent | f33068f6157bf1cbba2f37df0f41c80aa5fb19a5 (diff) | |
parent | f973737305aaa48ddf26f4455bdc8acdd7d03573 (diff) | |
download | CMake-be9d289fcef487753a5c88268e9ed4262e39633b.zip CMake-be9d289fcef487753a5c88268e9ed4262e39633b.tar.gz CMake-be9d289fcef487753a5c88268e9ed4262e39633b.tar.bz2 |
Merge topic 'deprecation-message'
f973737 GenerateExportHeader: Port to use message(DEPRECATION)
f69606d Qt4Macros: Port to use message(DEPRECATION)
509c142 message: Add a DEPRECATION mode
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMessageCommand.cxx | 17 | ||||
-rw-r--r-- | Source/cmMessageCommand.h | 8 | ||||
-rw-r--r-- | Source/cmake.cxx | 9 | ||||
-rw-r--r-- | Source/cmake.h | 4 |
4 files changed, 34 insertions, 4 deletions
diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index e1dbf34..d85e720 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -52,6 +52,23 @@ bool cmMessageCommand status = true; ++i; } + else if (*i == "DEPRECATION") + { + if (this->Makefile->IsOn("CMAKE_ERROR_DEPRECATED")) + { + fatal = true; + type = cmake::DEPRECATION_ERROR; + } + else if (this->Makefile->IsOn("CMAKE_WARN_DEPRECATED")) + { + type = cmake::DEPRECATION_WARNING; + } + else + { + return true; + } + ++i; + } for(;i != args.end(); ++i) { diff --git a/Source/cmMessageCommand.h b/Source/cmMessageCommand.h index fc61810..a053bdd 100644 --- a/Source/cmMessageCommand.h +++ b/Source/cmMessageCommand.h @@ -60,9 +60,8 @@ public: virtual const char* GetFullDocumentation() const { return - " message([STATUS|WARNING|AUTHOR_WARNING|FATAL_ERROR|SEND_ERROR]\n" - " \"message to display\" ...)\n" - "The optional keyword determines the type of message:\n" + " message([<mode>] \"message to display\" ...)\n" + "The optional <mode> keyword determines the type of message:\n" " (none) = Important information\n" " STATUS = Incidental information\n" " WARNING = CMake Warning, continue processing\n" @@ -70,6 +69,9 @@ public: " SEND_ERROR = CMake Error, continue processing,\n" " but skip generation\n" " FATAL_ERROR = CMake Error, stop processing and generation\n" + " DEPRECATION = CMake Deprecation Error or Warning if variable\n" + " CMAKE_ERROR_DEPRECATED or CMAKE_WARN_DEPRECATED\n" + " is enabled, respectively, else no message.\n" "The CMake command-line tool displays STATUS messages on stdout " "and all other message types on stderr. " "The CMake GUI displays all messages in its log area. " diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 2249323..d2961c0 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -3127,6 +3127,15 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, { msg << "CMake Debug Log"; } + else if(t == cmake::DEPRECATION_ERROR) + { + msg << "CMake Deprecation Error"; + isError = true; + } + else if (t == cmake::DEPRECATION_WARNING) + { + msg << "CMake Deprecation Warning"; + } else { msg << "CMake Warning"; diff --git a/Source/cmake.h b/Source/cmake.h index ccf91e3..d33ba34 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -65,7 +65,9 @@ class cmake INTERNAL_ERROR, MESSAGE, WARNING, - LOG + LOG, + DEPRECATION_ERROR, + DEPRECATION_WARNING }; |