From 2f922c6220704490912ce78a7dc5c8e07532b582 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 4 Mar 2008 18:42:06 -0500 Subject: [PATCH] ENH: Make CMAKE_MINIMUM_REQUIRED command FATAL_ERROR option implicit (always on). Accept but ignore the existing option. --- Source/cmCMakeMinimumRequired.cxx | 17 ++--------------- Source/cmCMakeMinimumRequired.h | 13 +++++++------ 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx index f20c06b1a..8d4aaf968 100644 --- a/Source/cmCMakeMinimumRequired.cxx +++ b/Source/cmCMakeMinimumRequired.cxx @@ -25,7 +25,6 @@ bool cmCMakeMinimumRequired // Process arguments. std::string version_string; bool doing_version = false; - bool fatal_error = false; for(unsigned int i=0; i < args.size(); ++i) { if(args[i] == "VERSION") @@ -40,7 +39,6 @@ bool cmCMakeMinimumRequired return false; } doing_version = false; - fatal_error = true; } else if(doing_version) { @@ -101,24 +99,13 @@ bool cmCMakeMinimumRequired { // The current version is too low. cmOStringStream e; - if(!fatal_error) - { - e << "WARNING: "; - } e << "This project requires version " << version_string.c_str() << " of CMake. " << "You are running version " << current_major << "." << current_minor << "." << current_patch << ".\n"; - if(fatal_error) - { - cmSystemTools::Error(e.str().c_str()); - cmSystemTools::SetFatalErrorOccured(); - } - else - { - cmSystemTools::Message(e.str().c_str()); - } + cmSystemTools::Error(e.str().c_str()); + cmSystemTools::SetFatalErrorOccured(); } // set the policy version as well diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h index 0fdd40866..d7a1b7e4b 100644 --- a/Source/cmCMakeMinimumRequired.h +++ b/Source/cmCMakeMinimumRequired.h @@ -66,12 +66,13 @@ public: virtual const char* GetFullDocumentation() { return - " cmake_minimum_required(VERSION versionNumber [FATAL_ERROR])\n" - "Let cmake know that the project requires a certain version of a " - "cmake, or newer. CMake will also try to be backwards compatible to " - "the version of cmake specified, if a newer version of cmake is " - "running. If FATAL_ERROR is given then failure to meet the " - "requirements will be considered an error instead of a warning."; + " cmake_minimum_required(VERSION major[.minor[.patch]]\n" + " [FATAL_ERROR])\n" + "If the current version of CMake is lower than that required " + "it will stop processing the project and report an error.\n" + "The FATAL_ERROR option is accepted but ignored. It is left from " + "CMake versions 2.4 and lower in which failure to meet the minimum " + "version was a warning by default."; } cmTypeMacro(cmCMakeMinimumRequired, cmCommand);