From 53e0ed3273c1a4a8f304f482220a474c3bc0e689 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 4 Mar 2008 18:41:52 -0500 Subject: BUG: Fix crash when CMAKE_BACKWARDS_COMPATIBILITY is not set. --- Source/cmGlobalGenerator.cxx | 4 +--- Source/cmIncludeDirectoryCommand.cxx | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 003788e..cf9d0a9 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -464,9 +464,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, // backwards compatibility files they have to load // These files have a bunch of try compiles in them so // should only be done - const char* versionValue - = mf->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY"); - if (atof(versionValue) <= 1.4) + if (mf->NeedBackwardsCompatibility(1,4)) { if(strcmp(lang, "C") == 0) { diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index e51116d..a39724a 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -50,11 +50,9 @@ bool cmIncludeDirectoryCommand } if(i->size() == 0) { - const char* versionValue = - this->Makefile->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY"); const char* errorMessage = "Empty Include Directory Passed into INCLUDE_DIRECTORIES command."; - if(atof(versionValue) < 2.5) + if(this->Makefile->NeedBackwardsCompatibility(2,4)) { cmSystemTools::Error(errorMessage); } -- cgit v0.12