| 3530 | } |
| 3531 | |
| 3532 | bool cmFindPackageCommand::SearchEnvironmentPrefix(std::string const& prefix) |
| 3533 | { |
| 3534 | assert(!prefix.empty() && prefix.back() == '/'); |
| 3535 | |
| 3536 | // Skip this if the prefix does not exist. |
| 3537 | if (!cmSystemTools::FileIsDirectory(prefix)) { |
| 3538 | return false; |
| 3539 | } |
| 3540 | |
| 3541 | auto searchFn = [this](std::string const& fullPath, |
| 3542 | PackageDescriptionType type) -> bool { |
| 3543 | return this->SearchDirectory(fullPath, type); |
| 3544 | }; |
| 3545 | |
| 3546 | auto pkgDirGen = |
| 3547 | cmProjectDirectoryListGenerator{ &this->Names, this->SortOrder, |
| 3548 | this->SortDirection, true }; |
| 3549 | |
| 3550 | // <environment-path>/(Foo|foo|FOO)/cps/ |
| 3551 | if (TryGeneratedPaths(searchFn, pdt::Cps, prefix, pkgDirGen, |
| 3552 | cmAppendPathSegmentGenerator{ "cps"_s })) { |
| 3553 | return true; |
| 3554 | } |
| 3555 | |
| 3556 | // <environment-path>/(Foo|foo|FOO)/ |
| 3557 | return TryGeneratedPaths(searchFn, pdt::Cps, prefix, pkgDirGen); |
| 3558 | } |
| 3559 | |
| 3560 | bool cmFindPackageCommand::IsRequired() const |
| 3561 | { |
no test coverage detected