diff -Naur cmake-2.8.5.orig/Source/cmFindPackageCommand.cxx cmake-2.8.5/Source/cmFindPackageCommand.cxx --- cmake-2.8.5.orig/Source/cmFindPackageCommand.cxx 2011-07-08 15:12:50.000000000 +0400 +++ cmake-2.8.5/Source/cmFindPackageCommand.cxx 2011-07-19 13:39:01.640015703 +0400 @@ -1731,10 +1731,10 @@ // Try to parse the version number and store the results that were // successfully parsed. - unsigned int parsed_major; - unsigned int parsed_minor; - unsigned int parsed_patch; - unsigned int parsed_tweak; + unsigned int parsed_major = 0; + unsigned int parsed_minor = 0; + unsigned int parsed_patch = 0; + unsigned int parsed_tweak = 0; this->VersionFoundCount = sscanf(this->VersionFound.c_str(), "%u.%u.%u.%u", &parsed_major, &parsed_minor, @@ -1751,6 +1751,7 @@ } result_version = this->Makefile->GetSafeDefinition("PACKAGE_VERSION"); + if(!this->VersionFoundCount) this->Makefile->RemoveDefinition("PACKAGE_FIND_VERSION"); if (result_version.empty()) { result_version = "unknown";