ENH: Make CMAKE_MINIMUM_REQUIRED command FATAL_ERROR option implicit (always on). Accept but ignore the existing option.
This commit is contained in:
parent
53e0ed3273
commit
2f922c6220
@ -25,7 +25,6 @@ bool cmCMakeMinimumRequired
|
|||||||
// Process arguments.
|
// Process arguments.
|
||||||
std::string version_string;
|
std::string version_string;
|
||||||
bool doing_version = false;
|
bool doing_version = false;
|
||||||
bool fatal_error = false;
|
|
||||||
for(unsigned int i=0; i < args.size(); ++i)
|
for(unsigned int i=0; i < args.size(); ++i)
|
||||||
{
|
{
|
||||||
if(args[i] == "VERSION")
|
if(args[i] == "VERSION")
|
||||||
@ -40,7 +39,6 @@ bool cmCMakeMinimumRequired
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
doing_version = false;
|
doing_version = false;
|
||||||
fatal_error = true;
|
|
||||||
}
|
}
|
||||||
else if(doing_version)
|
else if(doing_version)
|
||||||
{
|
{
|
||||||
@ -101,25 +99,14 @@ bool cmCMakeMinimumRequired
|
|||||||
{
|
{
|
||||||
// The current version is too low.
|
// The current version is too low.
|
||||||
cmOStringStream e;
|
cmOStringStream e;
|
||||||
if(!fatal_error)
|
|
||||||
{
|
|
||||||
e << "WARNING: ";
|
|
||||||
}
|
|
||||||
e << "This project requires version " << version_string.c_str()
|
e << "This project requires version " << version_string.c_str()
|
||||||
<< " of CMake. "
|
<< " of CMake. "
|
||||||
<< "You are running version "
|
<< "You are running version "
|
||||||
<< current_major << "." << current_minor << "." << current_patch
|
<< current_major << "." << current_minor << "." << current_patch
|
||||||
<< ".\n";
|
<< ".\n";
|
||||||
if(fatal_error)
|
|
||||||
{
|
|
||||||
cmSystemTools::Error(e.str().c_str());
|
cmSystemTools::Error(e.str().c_str());
|
||||||
cmSystemTools::SetFatalErrorOccured();
|
cmSystemTools::SetFatalErrorOccured();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
cmSystemTools::Message(e.str().c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// set the policy version as well
|
// set the policy version as well
|
||||||
this->Makefile->SetPolicyVersion(version_string.c_str());
|
this->Makefile->SetPolicyVersion(version_string.c_str());
|
||||||
|
@ -66,12 +66,13 @@ public:
|
|||||||
virtual const char* GetFullDocumentation()
|
virtual const char* GetFullDocumentation()
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
" cmake_minimum_required(VERSION versionNumber [FATAL_ERROR])\n"
|
" cmake_minimum_required(VERSION major[.minor[.patch]]\n"
|
||||||
"Let cmake know that the project requires a certain version of a "
|
" [FATAL_ERROR])\n"
|
||||||
"cmake, or newer. CMake will also try to be backwards compatible to "
|
"If the current version of CMake is lower than that required "
|
||||||
"the version of cmake specified, if a newer version of cmake is "
|
"it will stop processing the project and report an error.\n"
|
||||||
"running. If FATAL_ERROR is given then failure to meet the "
|
"The FATAL_ERROR option is accepted but ignored. It is left from "
|
||||||
"requirements will be considered an error instead of a warning.";
|
"CMake versions 2.4 and lower in which failure to meet the minimum "
|
||||||
|
"version was a warning by default.";
|
||||||
}
|
}
|
||||||
|
|
||||||
cmTypeMacro(cmCMakeMinimumRequired, cmCommand);
|
cmTypeMacro(cmCMakeMinimumRequired, cmCommand);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user