diff options
author | Bruno Manganelli <bruno.manga95@gmail.com> | 2018-11-22 03:36:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-16 13:16:31 (GMT) |
commit | cc2a5261f82c21e15899bba0d9b508fcacda7879 (patch) | |
tree | 38d9e0113178cd43c7f42898392452b6a8e8e84a /Source/cmFindPackageCommand.cxx | |
parent | da566d4de885130e182edc80f13691f5ca24bb61 (diff) | |
download | CMake-cc2a5261f82c21e15899bba0d9b508fcacda7879.zip CMake-cc2a5261f82c21e15899bba0d9b508fcacda7879.tar.gz CMake-cc2a5261f82c21e15899bba0d9b508fcacda7879.tar.bz2 |
Factor out enum MessageType into dedicated header
Reduce the number of files relying on `cmake.h`.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 3d9cd08..8dc7ca2 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -21,12 +21,12 @@ #include "cmAlgorithms.h" #include "cmMakefile.h" +#include "cmMessageType.h" #include "cmPolicies.h" #include "cmSearchPath.h" #include "cmState.h" #include "cmStateTypes.h" #include "cmVersion.h" -#include "cmake.h" #if defined(__HAIKU__) # include <FindDirectory.h> @@ -384,7 +384,8 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args, if (this->Version.empty() && this->VersionExact) { this->VersionExact = false; this->Makefile->IssueMessage( - cmake::AUTHOR_WARNING, "Ignoring EXACT since no version is requested."); + MessageType::AUTHOR_WARNING, + "Ignoring EXACT since no version is requested."); } if (this->Version.empty() || components.empty()) { @@ -473,7 +474,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args, case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: this->Makefile->IssueMessage( - cmake::FATAL_ERROR, + MessageType::FATAL_ERROR, cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0074)); break; case cmPolicies::NEW: { @@ -536,7 +537,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args, } aw << "\n" "(Variable CMAKE_FIND_PACKAGE_WARN_NO_MODULE enabled this warning.)"; - this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, aw.str()); + this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, aw.str()); } // No find module. Assume the project has a CMake config file. Use @@ -667,7 +668,7 @@ bool cmFindPackageCommand::FindModule(bool& found) case cmPolicies::WARN: { std::ostringstream e; e << cmPolicies::GetPolicyWarning(it->second) << "\n"; - this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str()); + this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, e.str()); CM_FALLTHROUGH; } case cmPolicies::OLD: @@ -736,7 +737,8 @@ bool cmFindPackageCommand::HandlePackageMode() // Sanity check. if (fileFound && this->FileFound.empty()) { this->Makefile->IssueMessage( - cmake::INTERNAL_ERROR, "fileFound is true but FileFound is empty!"); + MessageType::INTERNAL_ERROR, + "fileFound is true but FileFound is empty!"); fileFound = false; } } @@ -887,14 +889,15 @@ bool cmFindPackageCommand::HandlePackageMode() } } - this->Makefile->IssueMessage( - this->Required ? cmake::FATAL_ERROR : cmake::WARNING, e.str()); + this->Makefile->IssueMessage(this->Required ? MessageType::FATAL_ERROR + : MessageType::WARNING, + e.str()); if (this->Required) { cmSystemTools::SetFatalErrorOccured(); } if (!aw.str().empty()) { - this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, aw.str()); + this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, aw.str()); } } // output result if in config mode but not in quiet mode |