From 5588ed47fce7071b568914ceb0c4cfedb35195b7 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Thu, 6 Mar 2008 15:08:03 -0500 Subject: [PATCH] BUG: change in handling of cmake_minimum_required --- Source/cmConfigureFileCommand.cxx | 15 +++++++++++++-- Source/cmListFileCache.cxx | 7 +------ Source/cmPolicies.cxx | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index 2a8d3a4d18..d76888664e 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -47,10 +47,21 @@ bool cmConfigureFileCommand const char* versionValue = this->Makefile->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY"); if (versionValue && atof(versionValue) > 2.0) - { + { this->Immediate = true; - } + } + switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP_0003)) + { + case cmPolicies::WARN: + case cmPolicies::OLD: + break; + case cmPolicies::NEW: + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + this->Immediate = true; + } + this->AtOnly = false; for(unsigned int i=2;i < args.size();++i) diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 24ca7a4008..d76df60c93 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -134,11 +134,6 @@ bool cmListFile::ParseFile(const char* filename, hasPolicy = true; break; } - if (cmSystemTools::LowerCase(i->Name) == "cmake_minimum_required") - { - hasPolicy = true; - break; - } } // if no policy command is found this is an error if(!hasPolicy) @@ -148,7 +143,7 @@ bool cmListFile::ParseFile(const char* filename, GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")) { mf->AddCacheDefinition - ("CMAKE_BACKWARDS_COMPATIBILITY", "2.6", + ("CMAKE_BACKWARDS_COMPATIBILITY", "2.4", "For backwards compatibility, what version of CMake commands and " "syntax should this version of CMake try to support.", cmCacheManager::STRING); diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index f5e8ff9e9c..0f9c05f597 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -120,7 +120,7 @@ cmPolicies::cmPolicies() "In CMake 2.2 and later the default behavior is that it will " "configure the file right when the command is invoked." , - 2,2,0, cmPolicies::NEW); + 2,6,0, cmPolicies::NEW); // this->PolicyStringMap["CMP_CONFIGURE_FILE_IMMEDIATE"] = CMP_0003; }