summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-07-06 00:10:25 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-07-25 12:48:37 (GMT)
commit5447ca1a94309fa394be3a8233090b33e81e4c9f (patch)
treeadfd7aeeb174bffb6a739847e2a01f03351fd20f /Source
parentd0dcce15f4cc4e7c100556fbd016c59f64d0d238 (diff)
downloadCMake-5447ca1a94309fa394be3a8233090b33e81e4c9f.zip
CMake-5447ca1a94309fa394be3a8233090b33e81e4c9f.tar.gz
CMake-5447ca1a94309fa394be3a8233090b33e81e4c9f.tar.bz2
cmMakefile: Remove CMP0001 handling to callers.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCMakePolicyCommand.cxx16
-rw-r--r--Source/cmMakefile.cxx19
-rw-r--r--Source/cmPolicies.cxx16
3 files changed, 32 insertions, 19 deletions
diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx
index 3c878bf..3ef6d35 100644
--- a/Source/cmCMakePolicyCommand.cxx
+++ b/Source/cmCMakePolicyCommand.cxx
@@ -93,6 +93,22 @@ bool cmCMakePolicyCommand::HandleSetMode(std::vector<std::string> const& args)
this->SetError("SET failed to set policy.");
return false;
}
+ if(args[1] == "CMP0001" &&
+ (status == cmPolicies::WARN || status == cmPolicies::OLD))
+ {
+ if(!(this->Makefile->GetState()
+ ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")))
+ {
+ // Set it to 2.4 because that is the last version where the
+ // variable had meaning.
+ this->Makefile->AddCacheDefinition
+ ("CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
+ "For backwards compatibility, what version of CMake "
+ "commands and "
+ "syntax should this version of CMake try to support.",
+ cmState::STRING);
+ }
+ }
return true;
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d6854e7..c5ce2e9 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4822,25 +4822,6 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
previous_was_weak = psi->Weak;
}
- // Special hook for presenting compatibility variable as soon as
- // the user requests it.
- if(id == cmPolicies::CMP0001 &&
- (status == cmPolicies::WARN || status == cmPolicies::OLD))
- {
- if(!(this->GetState()
- ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")))
- {
- // Set it to 2.4 because that is the last version where the
- // variable had meaning.
- this->AddCacheDefinition
- ("CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
- "For backwards compatibility, what version of CMake "
- "commands and "
- "syntax should this version of CMake try to support.",
- cmState::STRING);
- }
- }
-
return true;
}
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 2a5ae1c..3eb19bb 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -255,6 +255,22 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf,
{
return false;
}
+ if(pid == cmPolicies::CMP0001 &&
+ (status == cmPolicies::WARN || status == cmPolicies::OLD))
+ {
+ if(!(mf->GetState()
+ ->GetInitializedCacheValue("CMAKE_BACKWARDS_COMPATIBILITY")))
+ {
+ // Set it to 2.4 because that is the last version where the
+ // variable had meaning.
+ mf->AddCacheDefinition
+ ("CMAKE_BACKWARDS_COMPATIBILITY", "2.4",
+ "For backwards compatibility, what version of CMake "
+ "commands and "
+ "syntax should this version of CMake try to support.",
+ cmState::STRING);
+ }
+ }
}
}
else