summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2008-03-05 16:41:25 (GMT)
committerKen Martin <ken.martin@kitware.com>2008-03-05 16:41:25 (GMT)
commitf2c6e9e4809c9a85293bd9d01183c99c4598c403 (patch)
treed81943651ce0baea6912f13893817c28a9df3143
parent7173f2db0e37a1621236b3ceeb883d4f1255ee42 (diff)
downloadCMake-f2c6e9e4809c9a85293bd9d01183c99c4598c403.zip
CMake-f2c6e9e4809c9a85293bd9d01183c99c4598c403.tar.gz
CMake-f2c6e9e4809c9a85293bd9d01183c99c4598c403.tar.bz2
BUG: some fixes, still a few to go
-rw-r--r--Source/cmConfigureFileCommand.cxx22
-rw-r--r--Source/cmMakefile.cxx4
-rw-r--r--Source/cmPolicies.cxx15
-rw-r--r--Source/cmPolicies.h4
4 files changed, 32 insertions, 13 deletions
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx
index 2a8d3a4..f2ce3da 100644
--- a/Source/cmConfigureFileCommand.cxx
+++ b/Source/cmConfigureFileCommand.cxx
@@ -42,15 +42,19 @@ bool cmConfigureFileCommand
// for CMake 2.0 and earlier CONFIGURE_FILE defaults to the FinalPass,
- // after 2.0 it only does InitialPass
- this->Immediate = false;
- const char* versionValue
- = this->Makefile->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY");
- if (versionValue && atof(versionValue) > 2.0)
- {
- this->Immediate = true;
- }
-
+ // after 2.0 it only does InitialPass, this is policy CMP_0003
+ switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP_0003))
+ {
+ case cmPolicies::WARN:
+ cmSystemTools::Message(
+ this->Makefile->GetPolicies()->GetPolicyWarning
+ (cmPolicies::CMP_0003).c_str(),"Warning");
+ case cmPolicies::OLD:
+ this->Immediate = false;
+ break;
+ default:
+ this->Immediate = true;
+ }
this->AtOnly = false;
for(unsigned int i=2;i < args.size();++i)
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9d109b6..e1cf841 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -138,6 +138,7 @@ cmMakefile::cmMakefile(const cmMakefile& mf)
this->PreOrder = mf.PreOrder;
this->ListFileStack = mf.ListFileStack;
this->Initialize();
+ this->PushPolicy();
}
//----------------------------------------------------------------------------
@@ -207,6 +208,7 @@ cmMakefile::~cmMakefile()
delete b;
}
this->FunctionBlockers.clear();
+ this->PolicyStack.pop_back();
}
void cmMakefile::PrintStringVector(const char* s,
@@ -3245,7 +3247,7 @@ cmPolicies::PolicyStatus cmMakefile
bool done = false;
// check our policy stack first
- for (vecpos = static_cast<int>(this->PolicyStack.size());
+ for (vecpos = static_cast<int>(this->PolicyStack.size()) - 1;
vecpos >= 0 && !done; vecpos--)
{
mappos = this->PolicyStack[vecpos].find(id);
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index b7e07e1..77d903f 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -112,7 +112,17 @@ cmPolicies::cmPolicies()
2,6,0, cmPolicies::WARN);
this->PolicyStringMap["CMP_REQUIRE_UNIQUE_TARGET_NAMES"] = CMP_0002;
-}
+ this->DefinePolicy(CMP_0003, "CMP_0003",
+ "CMake configures file immediately after 2.0.",
+ "In CMake 2.0 and earlier the configure_file command would not "
+ "configure the file until after processing all CMakeLists files. "
+ "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);
+ this->PolicyStringMap["CMP_CONFIGURE_FILE_IMMEDIATE"] = CMP_0003;
+
+ }
cmPolicies::~cmPolicies()
{
@@ -188,7 +198,8 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
// add in the old CMAKE_BACKWARDS_COMPATIBILITY var for old CMake compatibility
if ((majorVer == 2 && minorVer <= 4) || majorVer < 2)
{
- if (!mf->GetCacheManager()->GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))
+ if (!mf->GetCacheManager()->
+ GetCacheValue("CMAKE_BACKWARDS_COMPATIBILITY"))
{
mf->AddCacheDefinition
("CMAKE_BACKWARDS_COMPATIBILITY",version,
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index fc812d1..68745da 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -40,7 +40,9 @@ public:
enum PolicyID {CMP_0000, CMP_POLICY_SPECIFICATION = CMP_0000,
CMP_0001, CMP_TARGET_NAMES_WITH_SLASHES = CMP_0001,
- CMP_0002, CMP_REQUIRE_UNIQUE_TARGET_NAMES = CMP_0002};
+ CMP_0002, CMP_REQUIRE_UNIQUE_TARGET_NAMES = CMP_0002,
+ CMP_0003, CMP_CONFIGURE_FILE_IMMEDIATE = CMP_0003
+ };
///! convert a string policy ID into a number