Commit cc2a5261 authored by bmanga's avatar bmanga Committed by Brad King

Factor out enum MessageType into dedicated header

Reduce the number of files relying on `cmake.h`.
parent da566d4d
......@@ -298,6 +298,7 @@ set(SRCS
cmMakefileExecutableTargetGenerator.cxx
cmMakefileLibraryTargetGenerator.cxx
cmMakefileUtilityTargetGenerator.cxx
cmMessageType.h
cmMessenger.cxx
cmMessenger.h
cmMSVC60LinkLineComputer.cxx
......
......@@ -7,6 +7,7 @@
#include "cmCTestGenericHandler.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmSystemTools.h"
#include "cmake.h"
......@@ -95,7 +96,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
std::string e = "could not create generator named \"";
e += cmakeGeneratorName;
e += "\"";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e);
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e);
cmSystemTools::SetFatalErrorOccured();
return nullptr;
}
......
......@@ -5,9 +5,9 @@
#include "cmCTest.h"
#include "cmCTestGenericHandler.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmSystemTools.h"
#include "cmWorkingDirectory.h"
#include "cmake.h"
#include <cstring>
#include <sstream>
......@@ -289,7 +289,7 @@ bool cmCTestHandlerCommand::CheckArgumentValue(std::string const& arg)
if (this->Values[k]) {
std::ostringstream e;
e << "Called with more than one value for " << this->Arguments[k];
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
this->ArgumentDoing = ArgumentDoingError;
return true;
}
......
......@@ -6,8 +6,8 @@
#include "cmCTestGenericHandler.h"
#include "cmCTestSubmitHandler.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmSystemTools.h"
#include "cmake.h"
#include <sstream>
......@@ -203,7 +203,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
} else {
std::ostringstream e;
e << "Part name \"" << arg << "\" is invalid.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
this->ArgumentDoing = ArgumentDoingError;
}
return true;
......@@ -216,7 +216,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
std::ostringstream e;
e << "File \"" << arg << "\" does not exist. Cannot submit "
<< "a non-existent file.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
this->ArgumentDoing = ArgumentDoingError;
}
return true;
......
......@@ -9,8 +9,8 @@
#include "cmCTestGenericHandler.h"
#include "cmCTestUploadHandler.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmSystemTools.h"
#include "cmake.h"
cmCTestGenericHandler* cmCTestUploadCommand::InitializeHandler()
{
......@@ -58,7 +58,7 @@ bool cmCTestUploadCommand::CheckArgumentValue(std::string const& arg)
std::ostringstream e;
e << "File \"" << arg << "\" does not exist. Cannot submit "
<< "a non-existent file.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
this->ArgumentDoing = ArgumentDoingError;
return false;
}
......
......@@ -10,11 +10,11 @@
#include "cmCustomCommandLines.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmSourceFile.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmake.h"
class cmExecutionStatus;
......@@ -361,7 +361,7 @@ bool cmAddCustomCommandCommand::InitialPass(
} else {
bool issueMessage = true;
std::ostringstream e;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
MessageType messageType = MessageType::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0050)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0050) << "\n";
......@@ -372,7 +372,7 @@ bool cmAddCustomCommandCommand::InitialPass(
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::NEW:
messageType = cmake::FATAL_ERROR;
messageType = MessageType::FATAL_ERROR;
break;
}
......@@ -380,7 +380,7 @@ bool cmAddCustomCommandCommand::InitialPass(
e << "The SOURCE signatures of add_custom_command are no longer "
"supported.";
this->Makefile->IssueMessage(messageType, e.str());
if (messageType == cmake::FATAL_ERROR) {
if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
......
......@@ -9,10 +9,10 @@
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmake.h"
class cmExecutionStatus;
......@@ -183,19 +183,19 @@ bool cmAddCustomTargetCommand::InitialPass(
if (commandLines.empty() && !byproducts.empty()) {
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
MessageType::FATAL_ERROR,
"BYPRODUCTS may not be specified without any COMMAND");
return true;
}
if (commandLines.empty() && uses_terminal) {
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
MessageType::FATAL_ERROR,
"USES_TERMINAL may not be specified without any COMMAND");
return true;
}
if (commandLines.empty() && command_expand_lists) {
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
MessageType::FATAL_ERROR,
"COMMAND_EXPAND_LISTS may not be specified without any COMMAND");
return true;
}
......
......@@ -5,8 +5,8 @@
#include <sstream>
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmTarget.h"
#include "cmake.h"
class cmExecutionStatus;
......@@ -24,7 +24,7 @@ bool cmAddDependenciesCommand::InitialPass(
std::ostringstream e;
e << "Cannot add target-level dependencies to alias target \""
<< target_name << "\".\n";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
if (cmTarget* target = this->Makefile->FindTargetToUse(target_name)) {
std::vector<std::string>::const_iterator s = args.begin();
......@@ -40,7 +40,7 @@ bool cmAddDependenciesCommand::InitialPass(
<< "by the add_executable, add_library, or add_custom_target commands. "
<< "If you want to add file-level dependencies see the DEPENDS option "
<< "of the add_custom_target and add_custom_command commands.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
return true;
......
......@@ -7,11 +7,11 @@
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmake.h"
class cmExecutionStatus;
......@@ -259,7 +259,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
<< (type == cmStateEnums::SHARED_LIBRARY ? "SHARED" : "MODULE")
<< " option but the target platform does not support dynamic linking. "
"Building a STATIC library instead. This may lead to problems.";
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
type = cmStateEnums::STATIC_LIBRARY;
}
......@@ -275,7 +275,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (!this->Makefile->GetGlobalGenerator()->HasKnownObjectFileLocation(
&reason)) {
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
MessageType::FATAL_ERROR,
"The OBJECT library type may not be used for IMPORTED libraries" +
reason + ".");
return true;
......@@ -307,7 +307,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
// A non-imported target may not have UNKNOWN type.
if (type == cmStateEnums::UNKNOWN_LIBRARY) {
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
MessageType::FATAL_ERROR,
"The UNKNOWN library type may be used only for IMPORTED libraries.");
return true;
}
......
......@@ -6,8 +6,8 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmake.h"
// cmBreakCommand
bool cmBreakCommand::InitialPass(std::vector<std::string> const& args,
......@@ -16,7 +16,7 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args,
if (!this->Makefile->IsLoopBlock()) {
bool issueMessage = true;
std::ostringstream e;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
MessageType messageType = MessageType::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0055)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0055) << "\n";
......@@ -27,7 +27,7 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args,
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::NEW:
messageType = cmake::FATAL_ERROR;
messageType = MessageType::FATAL_ERROR;
break;
}
......@@ -35,7 +35,7 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args,
e << "A BREAK command was found outside of a proper "
"FOREACH or WHILE loop scope.";
this->Makefile->IssueMessage(messageType, e.str());
if (messageType == cmake::FATAL_ERROR) {
if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
......@@ -46,7 +46,7 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args,
if (!args.empty()) {
bool issueMessage = true;
std::ostringstream e;
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
MessageType messageType = MessageType::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0055)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0055) << "\n";
......@@ -57,14 +57,14 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args,
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::NEW:
messageType = cmake::FATAL_ERROR;
messageType = MessageType::FATAL_ERROR;
break;
}
if (issueMessage) {
e << "The BREAK command does not accept any arguments.";
this->Makefile->IssueMessage(messageType, e.str());
if (messageType == cmake::FATAL_ERROR) {
if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
......
......@@ -6,9 +6,9 @@
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmake.h"
class cmExecutionStatus;
......@@ -84,7 +84,7 @@ bool cmBuildCommand::MainSignature(std::vector<std::string> const& args)
if (!project_name.empty()) {
this->Makefile->IssueMessage(
cmake::AUTHOR_WARNING,
MessageType::AUTHOR_WARNING,
"Ignoring PROJECT_NAME option because it has no effect.");
}
......
......@@ -6,9 +6,9 @@
#include <stdio.h>
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmSystemTools.h"
#include "cmVersion.h"
#include "cmake.h"
class cmExecutionStatus;
......@@ -96,7 +96,7 @@ bool cmCMakeMinimumRequired::InitialPass(std::vector<std::string> const& args,
e << "CMake " << version_min
<< " or higher is required. You are running version "
<< cmVersion::GetCMakeVersion();
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured();
return true;
}
......@@ -108,7 +108,7 @@ bool cmCMakeMinimumRequired::InitialPass(std::vector<std::string> const& args,
if (required_major < 2 || (required_major == 2 && required_minor < 4)) {
this->Makefile->IssueMessage(
cmake::AUTHOR_WARNING,
MessageType::AUTHOR_WARNING,
"Compatibility with CMake < 2.4 is not supported by CMake >= 3.0.");
this->Makefile->SetPolicyVersion("2.4", version_max);
} else {
......
......@@ -5,10 +5,10 @@
#include <sstream>
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmake.h"
class cmExecutionStatus;
......@@ -146,7 +146,7 @@ bool cmCMakePolicyCommand::HandleGetMode(std::vector<std::string> const& args)
<< "The call to cmake_policy(GET " << id << " ...) at which this "
<< "error appears requests the policy, and this version of CMake "
<< "requires that the policy be set to NEW before it is checked.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
}
......
......@@ -347,7 +347,7 @@ static void addLinkLibrary(cmMakefile* mf, std::string const& target,
std::ostringstream e;
e << "Attempt to add link library \"" << lib << "\" to target \"" << target
<< "\" which is not built in this directory.";
mf->IssueMessage(cmake::FATAL_ERROR, e.str());
mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
......@@ -362,7 +362,7 @@ static void addLinkLibrary(cmMakefile* mf, std::string const& target,
<< " may not be linked into another target. "
<< "One may link only to STATIC or SHARED libraries, or "
<< "to executables with the ENABLE_EXPORTS property set.";
mf->IssueMessage(cmake::FATAL_ERROR, e.str());
mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
t->AddLinkLibrary(*mf, lib, llt);
......
......@@ -11,6 +11,7 @@
#include <string>
#include "cmGeneratedFileStream.h"
#include "cmMessageType.h"
#include "cmMessenger.h"
#include "cmState.h"
#include "cmSystemTools.h"
......@@ -478,7 +479,7 @@ void cmCacheManager::OutputNewlineTruncationWarning(std::ostream& fout,
std::string message = "Value of ";
message += key;
message += " contained a newline; truncating";
messenger->IssueMessage(cmake::WARNING, message);
messenger->IssueMessage(MessageType::WARNING, message);
}
std::string comment = "WARNING: Value of ";
......
......@@ -8,6 +8,7 @@
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmOrderDirectories.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
......@@ -522,7 +523,7 @@ bool cmComputeLinkInformation::Compute()
"name."
;
/* clang-format on */
this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
this->CMakeInstance->IssueMessage(MessageType::AUTHOR_WARNING, w.str(),
this->Target->GetBacktrace());
}
......@@ -1382,7 +1383,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
<< " " << item << "\n"
<< "which is a full-path but not a valid library file name.";
/* clang-format on */
this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
this->CMakeInstance->IssueMessage(MessageType::AUTHOR_WARNING, w.str(),
this->Target->GetBacktrace());
}
}
......@@ -1401,7 +1402,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
<< " " << item << "\n"
<< "which is a full-path but not a valid library file name.";
/* clang-format on */
this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(),
this->CMakeInstance->IssueMessage(MessageType::FATAL_ERROR, e.str(),
this->Target->GetBacktrace());
} break;
}
......@@ -1424,7 +1425,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
"CMP0003-WARNING-GIVEN", "1");
std::ostringstream w;
this->PrintLinkPolicyDiagnosis(w);
this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
this->CMakeInstance->IssueMessage(MessageType::AUTHOR_WARNING, w.str(),
this->Target->GetBacktrace());
}
case cmPolicies::OLD:
......@@ -1439,7 +1440,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
std::ostringstream e;
e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0003) << "\n";
this->PrintLinkPolicyDiagnosis(e);
this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(),
this->CMakeInstance->IssueMessage(MessageType::FATAL_ERROR, e.str(),
this->Target->GetBacktrace());
return false;
}
......
......@@ -9,6 +9,7 @@
#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmSourceFile.h"
#include "cmState.h"
......@@ -217,7 +218,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
depender->GetType() != cmStateEnums::MODULE_LIBRARY &&
depender->GetType() != cmStateEnums::OBJECT_LIBRARY) {
this->GlobalGenerator->GetCMakeInstance()->IssueMessage(
cmake::FATAL_ERROR,
MessageType::FATAL_ERROR,
"Only executables and libraries may reference target objects.",
depender->GetBacktrace());
return;
......@@ -314,7 +315,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
if (!dependee && !linking &&
(depender->GetType() != cmStateEnums::GLOBAL_TARGET)) {
cmake::MessageType messageType = cmake::AUTHOR_WARNING;
MessageType messageType = MessageType::AUTHOR_WARNING;
bool issueMessage = false;
std::ostringstream e;
switch (depender->GetPolicyStatusCMP0046()) {
......@@ -327,7 +328,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
issueMessage = true;
messageType = cmake::FATAL_ERROR;
messageType = MessageType::FATAL_ERROR;
}
if (issueMessage) {
cmake* cm = this->GlobalGenerator->GetCMakeInstance();
......
......@@ -11,8 +11,10 @@
#include "cmAlgorithms.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmState.h"
#include "cmSystemTools.h"
#include "cmake.h"
class cmCommand;
class cmTest;
......@@ -81,7 +83,7 @@ cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile,
bool cmConditionEvaluator::IsTrue(
const std::vector<cmExpandedCommandArgument>& args, std::string& errorString,
cmake::MessageType& status)
MessageType& status)
{
errorString.clear();
......@@ -123,7 +125,7 @@ bool cmConditionEvaluator::IsTrue(
// now at the end there should only be one argument left
if (newArgs.size() != 1) {
errorString = "Unknown arguments specified";
status = cmake::FATAL_ERROR;
status = MessageType::FATAL_ERROR;
return false;
}
......@@ -155,7 +157,7 @@ const char* cmConditionEvaluator::GetDefinitionIfUnquoted(
"Since the policy is not set the OLD behavior will be used.";
this->Makefile.GetCMakeInstance()->IssueMessage(
cmake::AUTHOR_WARNING, e.str(), this->Backtrace);
MessageType::AUTHOR_WARNING, e.str(), this->Backtrace);
}
}
......@@ -199,7 +201,7 @@ bool cmConditionEvaluator::IsKeyword(std::string const& keyword,
"Since the policy is not set the OLD behavior will be used.";
this->Makefile.GetCMakeInstance()->IssueMessage(
cmake::AUTHOR_WARNING, e.str(), this->Backtrace);
MessageType::AUTHOR_WARNING, e.str(), this->Backtrace);
}
}
......@@ -269,7 +271,7 @@ bool cmConditionEvaluator::GetBooleanValueOld(
// returns the resulting boolean value
bool cmConditionEvaluator::GetBooleanValueWithAutoDereference(
cmExpandedCommandArgument& newArg, std::string& errorString,
cmake::MessageType& status, bool oneArg) const
MessageType& status, bool oneArg) const
{
// Use the policy if it is set.
if (this->Policy12Status == cmPolicies::NEW) {
......@@ -288,7 +290,7 @@ bool cmConditionEvaluator::GetBooleanValueWithAutoDereference(
errorString = "An argument named \"" + newArg.GetValue() +
"\" appears in a conditional statement. " +
cmPolicies::GetPolicyWarning(cmPolicies::CMP0012);
status = cmake::AUTHOR_WARNING;
status = MessageType::AUTHOR_WARNING;
CM_FALLTHROUGH;
case cmPolicies::OLD:
return oldResult;
......@@ -297,7 +299,7 @@ bool cmConditionEvaluator::GetBooleanValueWithAutoDereference(
errorString = "An argument named \"" + newArg.GetValue() +
"\" appears in a conditional statement. " +
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0012);
status = cmake::FATAL_ERROR;
status = MessageType::FATAL_ERROR;
}
case cmPolicies::NEW:
break;
......@@ -362,7 +364,7 @@ void cmConditionEvaluator::HandleBinaryOp(bool value, int& reducible,
// level 0 processes parenthetical expressions
bool cmConditionEvaluator::HandleLevel0(cmArgumentList& newArgs,
std::string& errorString,
cmake::MessageType& status)
MessageType& status)
{
int reducible;
do {
......@@ -386,7 +388,7 @@ bool cmConditionEvaluator::HandleLevel0(cmArgumentList& newArgs,
}
if (depth) {
errorString = "mismatched parenthesis in condition";
status = cmake::FATAL_ERROR;
status = MessageType::FATAL_ERROR;
return false;
}
// store the reduced args in this vector
......@@ -419,7 +421,7 @@ bool cmConditionEvaluator::HandleLevel0(cmArgumentList& newArgs,
//=========================================================================
// level one handles most predicates except for NOT
bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
cmake::MessageType&)
MessageType&)
{
int reducible;
do {
......@@ -485,7 +487,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
"when the policy is set to NEW. "
"Since the policy is not set the OLD behavior will be used.";
this->Makefile.IssueMessage(cmake::AUTHOR_WARNING, e.str());
this->Makefile.IssueMessage(MessageType::AUTHOR_WARNING, e.str());
}
// is a variable defined
if (this->IsKeyword(keyDEFINED, *arg) && argP1 != newArgs.end()) {
......@@ -516,7 +518,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
// level two handles most binary operations except for AND OR
bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
std::string& errorString,
cmake::MessageType& status)
MessageType& status)
{
int reducible;
std::string def_buf;
......@@ -547,7 +549,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
std::ostringstream error;
error << "Regular expression \"" << rex << "\" cannot compile";
errorString = error.str();
status = cmake::FATAL_ERROR;
status = MessageType::FATAL_ERROR;
return false;
}
if (regEntry.find(def)) {
......@@ -682,7 +684,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
"when the policy is set to NEW. "
"Since the policy is not set the OLD behavior will be used.";
this->Makefile.IssueMessage(cmake::AUTHOR_WARNING, e.str());
this->Makefile.IssueMessage(MessageType::AUTHOR_WARNING, e.str());
}
}
......@@ -696,7 +698,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
// level 3 handles NOT
bool cmConditionEvaluator::HandleLevel3(cmArgumentList& newArgs,
std::string& errorString,
cmake::MessageType& status)
MessageType& status)
{
int reducible;
do {
......@@ -722,7 +724,7 @@ bool cmConditionEvaluator::HandleLevel3(cmArgumentList& newArgs,
// level 4 handles AND OR
bool cmConditionEvaluator::HandleLevel4(cmArgumentList& newArgs,
std::string& errorString,
cmake::MessageType& status)
MessageType& status)
{
int reducible;
bool lhs;
......
......@@ -11,8 +11,8 @@
#include "cmExpandedCommandArgument.h"
#include "cmListFileCache.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmake.h"
class cmMakefile;
......@@ -28,7 +28,7 @@ public:
// arguments were valid, and if so, was the response true. If there is
// an error, the errorString will be set.
bool IsTrue(const std::vector<cmExpandedCommandArgument>& args,
std::string& errorString, cmake::MessageType& status);
std::string& errorString, MessageType& status);
private:
// Filter the given variable definition based on policy CMP0054.
......@@ -48,7 +48,7 @@ private:
bool GetBooleanValueWithAutoDereference(cmExpandedCommandArgument& newArg,
std::string& errorString,
cmake::MessageType& status,
MessageType& status,
bool oneArg = false) const;
void IncrementArguments(cmArgumentList& newArgs,
......@@ -66,19 +66,18 @@ private:
cmArgumentList::iterator& argP2);
bool HandleLevel0(cmArgumentList& newArgs, std::string& errorString,
cmake::MessageType& status);
MessageType& status);
bool HandleLevel1(cmArgumentList& newArgs, std::string&,
cmake::MessageType&);
bool HandleLevel1(cmArgumentList& newArgs, std::string&, MessageType&);
bool HandleLevel2(cmArgumentList& newArgs, std::string& errorString,
cmake::MessageType& status);
MessageType& status);
bool HandleLevel3(cmArgumentList& newArgs, std::string& errorString,
cmake::MessageType& status);
MessageType& status);
bool HandleLevel4(cmArgumentList& newArgs, std::string& errorString,
cmake::MessageType& status);
MessageType& status);
cmMakefile& Makefile;
cmListFileContext ExecutionContext;
......
......@@ -5,8 +5,8 @@
#include <sstream>
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmSystemTools.h"
#include "cmake.h"
class cmExecutionStatus;