Merge topic 'find_library-simplify-regex'

f60e921262 find_library: Improve regex readability in --debug-find output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8618
This commit is contained in:
Brad King
2023-07-14 12:42:00 +00:00
committed by Kitware Robot
3 changed files with 10 additions and 4 deletions
+8 -2
View File
@@ -251,8 +251,14 @@ struct cmFindLibraryHelper
void DebugLibraryFailed(std::string const& name, std::string const& path)
{
if (this->DebugMode) {
auto regexName =
cmStrCat(this->PrefixRegexStr, name, this->SuffixRegexStr);
// To improve readability of the debug output, if there is only one
// prefix/suffix, use the plain prefix/suffix instead of the regex.
const auto& prefix = (this->Prefixes.size() == 1) ? this->Prefixes[0]
: this->PrefixRegexStr;
const auto& suffix = (this->Suffixes.size() == 1) ? this->Suffixes[0]
: this->SuffixRegexStr;
auto regexName = cmStrCat(prefix, name, suffix);
this->DebugSearches.FailedAt(path, regexName);
}
}
@@ -1,4 +1,4 @@
.*find_library considered the following locations.*
.*\(lib\)library_no_exist\(\\.tbd\|\\.dylib\|\\.so\|\\.a\).*
.*liblibrary_no_exist\(\\.tbd\|\\.dylib\|\\.so\|\\.a\).*
.*The item was found at.*
.*lib/libcreated.a.*
@@ -1,4 +1,4 @@
.*find_library considered the following locations.*
.*\(lib\)library_no_exist\(\\.so\|\\.a\).*
.*liblibrary_no_exist\(\\.so\|\\.a\).*
.*The item was found at.*
.*lib/libcreated.a.*