瀏覽代碼

find_package: CPS targets use CMP0200

Tweak CPS import to actually set CMP0200 NEW on targets imported from
CPS (as the documentation claims we do).
Matthew Woehlke 1 月之前
父節點
當前提交
c6a6d47233
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      Source/cmFindPackageCommand.cxx

+ 4 - 1
Source/cmFindPackageCommand.cxx

@@ -2107,7 +2107,10 @@ bool cmFindPackageCommand::ReadPackage()
   bool const hasComponentsRequested =
     !this->RequiredComponents.empty() || !this->OptionalComponents.empty();
 
-  cmMakefile::CallRAII scope{ this->Makefile, this->FileFound, this->Status };
+  cmMakefile::CallRAII cs{ this->Makefile, this->FileFound, this->Status };
+  cmMakefile::PolicyPushPop ps{ this->Makefile };
+
+  this->Makefile->SetPolicy(cmPolicies::CMP0200, cmPolicies::NEW);
 
   // Loop over appendices.
   auto iter = this->CpsAppendices.begin();