mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-13 12:59:55 -05:00
find_library: Improve regex readability in --debug-find output
If there is only one possible library prefix/suffix, omit the capture group around it in the debug output.
This commit is contained in:
committed by
Brad King
parent
b8b53db1b3
commit
f60e921262
@@ -251,8 +251,14 @@ struct cmFindLibraryHelper
|
|||||||
void DebugLibraryFailed(std::string const& name, std::string const& path)
|
void DebugLibraryFailed(std::string const& name, std::string const& path)
|
||||||
{
|
{
|
||||||
if (this->DebugMode) {
|
if (this->DebugMode) {
|
||||||
auto regexName =
|
// To improve readability of the debug output, if there is only one
|
||||||
cmStrCat(this->PrefixRegexStr, name, this->SuffixRegexStr);
|
// 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);
|
this->DebugSearches.FailedAt(path, regexName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.*find_library considered the following locations.*
|
.*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.*
|
.*The item was found at.*
|
||||||
.*lib/libcreated.a.*
|
.*lib/libcreated.a.*
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.*find_library considered the following locations.*
|
.*find_library considered the following locations.*
|
||||||
.*\(lib\)library_no_exist\(\\.so\|\\.a\).*
|
.*liblibrary_no_exist\(\\.so\|\\.a\).*
|
||||||
.*The item was found at.*
|
.*The item was found at.*
|
||||||
.*lib/libcreated.a.*
|
.*lib/libcreated.a.*
|
||||||
|
|||||||
Reference in New Issue
Block a user