| 83 | }); |
| 84 | } |
| 85 | bool CheckDirectoryForName(std::string const& path, std::string const& name) |
| 86 | { |
| 87 | return std::any_of(this->Extensions.begin(), this->Extensions.end(), |
| 88 | [this, &path, &name](std::string const& ext) -> bool { |
| 89 | if (!ext.empty() && cmHasSuffix(name, ext)) { |
| 90 | return false; |
| 91 | } |
| 92 | std::string testNameExt = cmStrCat(name, ext); |
| 93 | std::string testPath = |
| 94 | cmSystemTools::CollapseFullPath(testNameExt, path); |
| 95 | if (this->FileIsExecutable(testPath)) { |
| 96 | testPath = |
| 97 | cmSystemTools::ToNormalizedPathOnDisk(testPath); |
| 98 | if (this->FindBase->Validate(testPath)) { |
| 99 | this->BestPath = testPath; |
| 100 | if (this->DebugState) { |
| 101 | this->DebugState->FoundAt(testPath); |
| 102 | } |
| 103 | return true; |
| 104 | } |
| 105 | } |
| 106 | if (this->DebugState) { |
| 107 | this->DebugState->FailedAt(testPath); |
| 108 | } |
| 109 | return false; |
| 110 | }); |
| 111 | } |
| 112 | bool FileIsExecutable(std::string const& file) const |
| 113 | { |
| 114 | if (!this->FileIsExecutableCMP0109(file)) { |
no test coverage detected