summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 3719fe1..fba736e 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1138,6 +1138,11 @@ bool cmFindPackageCommand::FindConfig()
// We force the value since we do not get here if it was already set.
this->Makefile->AddCacheDefinition(this->Variable, init, help.c_str(),
cmStateEnums::PATH, true);
+ if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0126) ==
+ cmPolicies::NEW &&
+ this->Makefile->IsNormalDefinitionSet(this->Variable)) {
+ this->Makefile->AddDefinition(this->Variable, init);
+ }
return found;
}