mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
cmFind*Command: Simplify file validation code paths
This commit is contained in:
@@ -422,18 +422,15 @@ bool cmFindLibraryHelper::CheckDirectoryForName(std::string const& path,
|
||||
if (name.TryRaw) {
|
||||
std::string testPath = cmStrCat(path, name.Raw);
|
||||
|
||||
const bool exists = cmSystemTools::FileExists(testPath, true);
|
||||
if (!exists) {
|
||||
this->DebugLibraryFailed(name.Raw, path);
|
||||
} else {
|
||||
if (cmSystemTools::FileExists(testPath, true)) {
|
||||
testPath = cmSystemTools::CollapseFullPath(testPath);
|
||||
if (this->Validate(testPath)) {
|
||||
this->DebugLibraryFound(name.Raw, path);
|
||||
this->BestPath = testPath;
|
||||
return true;
|
||||
}
|
||||
this->DebugLibraryFailed(name.Raw, path);
|
||||
}
|
||||
this->DebugLibraryFailed(name.Raw, path);
|
||||
}
|
||||
|
||||
// No library file has yet been found.
|
||||
|
||||
Reference in New Issue
Block a user