From 2d842b6798cb51bc8c2006b708c348af8720fca6 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 16 Dec 2008 09:23:41 -0500 Subject: [PATCH] BUG: find_package must push/pop policies When the find_package command loads a -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. --- Source/cmFindPackageCommand.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 78b73fd22..9e998aad5 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.