diff options
author | Bruno Manganelli <bruno.manga95@gmail.com> | 2018-11-22 03:36:50 +0000 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-16 08:16:31 -0500 |
commit | cc2a5261f82c21e15899bba0d9b508fcacda7879 (patch) | |
tree | 38d9e0113178cd43c7f42898392452b6a8e8e84a /Source/cmMessageCommand.cxx | |
parent | da566d4de885130e182edc80f13691f5ca24bb61 (diff) | |
download | cmake-cc2a5261f82c21e15899bba0d9b508fcacda7879.tar.gz |
Factor out enum MessageType into dedicated header
Reduce the number of files relying on `cmake.h`.
Diffstat (limited to 'Source/cmMessageCommand.cxx')
-rw-r--r-- | Source/cmMessageCommand.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 5a341bd2b4..4c26c66686 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -4,9 +4,9 @@ #include "cmAlgorithms.h" #include "cmMakefile.h" +#include "cmMessageType.h" #include "cmMessenger.h" #include "cmSystemTools.h" -#include "cmake.h" class cmExecutionStatus; @@ -20,26 +20,26 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args, } std::vector<std::string>::const_iterator i = args.begin(); - cmake::MessageType type = cmake::MESSAGE; + MessageType type = MessageType::MESSAGE; bool status = false; bool fatal = false; if (*i == "SEND_ERROR") { - type = cmake::FATAL_ERROR; + type = MessageType::FATAL_ERROR; ++i; } else if (*i == "FATAL_ERROR") { fatal = true; - type = cmake::FATAL_ERROR; + type = MessageType::FATAL_ERROR; ++i; } else if (*i == "WARNING") { - type = cmake::WARNING; + type = MessageType::WARNING; ++i; } else if (*i == "AUTHOR_WARNING") { if (this->Makefile->IsSet("CMAKE_SUPPRESS_DEVELOPER_ERRORS") && !this->Makefile->IsOn("CMAKE_SUPPRESS_DEVELOPER_ERRORS")) { fatal = true; - type = cmake::AUTHOR_ERROR; + type = MessageType::AUTHOR_ERROR; } else if (!this->Makefile->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS")) { - type = cmake::AUTHOR_WARNING; + type = MessageType::AUTHOR_WARNING; } else { return true; } @@ -50,10 +50,10 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args, } else if (*i == "DEPRECATION") { if (this->Makefile->IsOn("CMAKE_ERROR_DEPRECATED")) { fatal = true; - type = cmake::DEPRECATION_ERROR; + type = MessageType::DEPRECATION_ERROR; } else if ((!this->Makefile->IsSet("CMAKE_WARN_DEPRECATED") || this->Makefile->IsOn("CMAKE_WARN_DEPRECATED"))) { - type = cmake::DEPRECATION_WARNING; + type = MessageType::DEPRECATION_WARNING; } else { return true; } @@ -62,7 +62,7 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args, std::string message = cmJoin(cmMakeRange(i, args.end()), std::string()); - if (type != cmake::MESSAGE) { + if (type != MessageType::MESSAGE) { // we've overridden the message type, above, so display it directly cmMessenger* m = this->Makefile->GetMessenger(); m->DisplayMessage(type, message, this->Makefile->GetBacktrace()); |