summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-07-21 18:44:00 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-07-21 18:44:00 (GMT)
commit18c6f9e0c51cd66ba5abfe9f572184a18c17c2f3 (patch)
tree8358ba5f000f492e4137f7a064cf80863df04bcd /Source/cmMakefile.cxx
parent0e1de8a9f25660f5f5c98176fc116646a43786d1 (diff)
downloadCMake-18c6f9e0c51cd66ba5abfe9f572184a18c17c2f3.zip
CMake-18c6f9e0c51cd66ba5abfe9f572184a18c17c2f3.tar.gz
CMake-18c6f9e0c51cd66ba5abfe9f572184a18c17c2f3.tar.bz2
ENH: Initial framework for deprecated commands
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0e9534a..6d196f8 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -196,6 +196,23 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff)
this->GetCMakeInstance()->GetCommand(name.c_str());
if(rm)
{
+ const char* versionValue
+ = this->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY");
+ int major = 0;
+ int minor = 0;
+ if ( versionValue )
+ {
+ sscanf(versionValue, "%d.%d", &major, &minor);
+ }
+ if ( rm->IsDeprecated(major, minor) )
+ {
+ cmOStringStream error;
+ error << "Error in cmake code at\n"
+ << lff.m_FilePath << ":" << lff.m_Line << ":\n"
+ << rm->GetError();
+ cmSystemTools::Error(error.str().c_str());
+ return false;
+ }
cmCommand* usedCommand = rm->Clone();
usedCommand->SetMakefile(this);
bool keepCommand = false;
@@ -209,8 +226,8 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff)
{
cmOStringStream error;
error << "Error in cmake code at\n"
- << lff.m_FilePath << ":" << lff.m_Line << ":\n"
- << usedCommand->GetError();
+ << lff.m_FilePath << ":" << lff.m_Line << ":\n"
+ << usedCommand->GetError();
cmSystemTools::Error(error.str().c_str());
result = false;
}