ENH: remove old 1.2 compatability from cmake 2.2

This commit is contained in:
Ken Martin 2005-06-10 10:45:43 -04:00
parent e559aa11ac
commit 80f796039c
1 changed files with 9 additions and 32 deletions

View File

@ -391,7 +391,7 @@ bool cmMakefile::ReadListFile(const char* filename_in, const char *external_in)
this->ExecuteCommand(lf->m_Functions[i]); this->ExecuteCommand(lf->m_Functions[i]);
if ( cmSystemTools::GetFatalErrorOccured() ) if ( cmSystemTools::GetFatalErrorOccured() )
{ {
return false; return true;
} }
} }
@ -446,20 +446,17 @@ void cmMakefile::FinalPass()
void cmMakefile::ConfigureFinalPass() void cmMakefile::ConfigureFinalPass()
{ {
this->FinalPass(); this->FinalPass();
const char* versionValue const char* oldValue
= this->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION"); = this->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY");
bool oldVersion = (!versionValue || atof(versionValue) < 1.4); if (oldValue && atof(oldValue) <= 1.2)
// merge libraries {
cmSystemTools::Error("You have requested backwards compatibility with CMake version 1.2 or earlier. This version of CMake only supports backwards compatibility with CMake 1.4 or later. For compatibility with 1.2 or earlier please use CMake 2.0");
}
for (cmTargets::iterator l = m_Targets.begin(); for (cmTargets::iterator l = m_Targets.begin();
l != m_Targets.end(); l++) l != m_Targets.end(); l++)
{ {
l->second.GenerateSourceFilesFromSourceLists(*this); l->second.GenerateSourceFilesFromSourceLists(*this);
// pick up any LINK_LIBRARIES that were added after the target
if(oldVersion)
{
this->AddGlobalLinkInformation(l->first.c_str(), l->second);
}
l->second.AnalyzeLibDependencies(*this); l->second.AnalyzeLibDependencies(*this);
} }
} }
@ -1955,32 +1952,12 @@ void cmMakefile::ExpandSourceListArguments(
std::vector<std::string> const& arguments, std::vector<std::string> const& arguments,
std::vector<std::string>& newargs, unsigned int start) std::vector<std::string>& newargs, unsigned int start)
{ {
// first figure out if we need to handle version 1.2 style source lists
int oldVersion = 1;
const char* versionValue
= this->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
if (versionValue && atof(versionValue) > 1.2)
{
oldVersion = 0;
}
// now expand the args // now expand the args
unsigned int i; unsigned int i;
for(i = 0; i < arguments.size(); ++i) for(i = 0; i < arguments.size(); ++i)
{ {
// is the arg defined ?, if so use the def // List expansion will have been done already.
const char *def = this->GetDefinition(arguments[i].c_str()); newargs.push_back(arguments[i]);
if (def && oldVersion && i >= start)
{
// Definition lookup could result in a list that needs to be
// expanded.
cmSystemTools::ExpandListArgument(def, newargs);
}
else
{
// List expansion will have been done already.
newargs.push_back(arguments[i]);
}
} }
} }