summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-12-16 14:23:41 (GMT)
committerBrad King <brad.king@kitware.com>2008-12-16 14:23:41 (GMT)
commit2d842b6798cb51bc8c2006b708c348af8720fca6 (patch)
tree93832f3da4ee50bc1c99ef4044721dda92a39e94 /Source/cmFindPackageCommand.cxx
parentb14abe31a9a1956e306e3f90747389c920164128 (diff)
downloadCMake-2d842b6798cb51bc8c2006b708c348af8720fca6.zip
CMake-2d842b6798cb51bc8c2006b708c348af8720fca6.tar.gz
CMake-2d842b6798cb51bc8c2006b708c348af8720fca6.tar.bz2
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.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 78b73fd..9e998aa 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/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.