Преглед на файлове

BUG: find_package must push/pop policies

When the find_package command loads a <name>-version.cmake file to test
the package version it must prevent the version file from affecting
policy settings.  Therefore the policy settings must be pushed and
popped.
Brad King преди 17 години
родител
ревизия
2d842b6798
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2 0
      Source/cmFindPackageCommand.cxx

+ 2 - 0
Source/cmFindPackageCommand.cxx

@@ -1298,6 +1298,7 @@ bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file)
 {
   // The version file will be loaded in an isolated scope.
   this->Makefile->PushScope();
+  this->Makefile->PushPolicy();
 
   // Clear the output variables.
   this->Makefile->RemoveDefinition("PACKAGE_VERSION");
@@ -1364,6 +1365,7 @@ bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file)
     }
 
   // Restore the original scope.
+  this->Makefile->PopPolicy();
   this->Makefile->PopScope();
 
   // Succeed if the version is suitable.