find_package: Find CPS dependencies

Implement finding dependencies of CPS packages. This is done by setting
up additional `cmFindPackageCommand` instances which are used to look
for a parent package's dependencies.
This commit is contained in:
Matthew Woehlke
2024-12-17 12:50:33 -05:00
committed by Brad King
parent e6d5a518b1
commit 42de87cbae
16 changed files with 342 additions and 46 deletions
+14 -4
View File
@@ -92,10 +92,12 @@ private:
static PathLabel SystemRegistry;
};
void InheritOptions(cmFindPackageCommand* other);
// Try to find a package, assuming most state has already been set up. This
// is used for recursive dependency solving, particularly when importing
// packages via CPS. Bypasses providers if argsForProvider is empty.
bool FindPackage(std::vector<std::string> const& argsForProvider);
bool FindPackage(std::vector<std::string> const& argsForProvider = {});
bool FindPackageUsingModuleMode();
bool FindPackageUsingConfigMode();
@@ -137,9 +139,17 @@ private:
DoPolicyScope
};
bool ReadListFile(const std::string& f, PolicyScopeRule psr);
bool ImportTargetConfigurations(std::string const& base,
cmPackageInfoReader* parent);
bool ImportAppendices(std::string const& base);
bool ReadPackage();
using AppendixMap =
std::map<std::string, std::unique_ptr<cmPackageInfoReader>>;
AppendixMap FindAppendices(std::string const& base) const;
bool FindPackageDependencies(std::string const& fileName,
cmPackageInfoReader const& reader,
bool required);
bool ImportPackageTargets(std::string const& fileName,
cmPackageInfoReader& reader);
void StoreVersionFound();
void SetConfigDirCacheVariable(const std::string& value);