| 395 | } |
| 396 | |
| 397 | void cmFindLibraryHelper::AddName(std::string const& name) |
| 398 | { |
| 399 | Name entry; |
| 400 | |
| 401 | // Consider checking the raw name too. |
| 402 | entry.TryRaw = this->HasValidSuffix(name); |
| 403 | entry.Raw = name; |
| 404 | |
| 405 | // Build a regular expression to match library names. |
| 406 | { |
| 407 | std::string regex = cmStrCat('^', this->PrefixRegexStr); |
| 408 | this->RegexFromLiteral(regex, name, cmSystemTools::DirCase::Sensitive); |
| 409 | regex += this->SuffixRegexStr; |
| 410 | if (this->IsOpenBSD) { |
| 411 | regex += "(\\.[0-9]+\\.[0-9]+)?"; |
| 412 | } |
| 413 | regex += "$"; |
| 414 | entry.Regex.compile(regex); |
| 415 | } |
| 416 | |
| 417 | // case insensitive version |
| 418 | { |
| 419 | std::string regex = cmStrCat('^', this->ICasePrefixRegexStr); |
| 420 | this->RegexFromLiteral(regex, name, cmSystemTools::DirCase::Insensitive); |
| 421 | regex += this->ICaseSuffixRegexStr; |
| 422 | if (this->IsOpenBSD) { |
| 423 | regex += "(\\.[0-9]+\\.[0-9]+)?"; |
| 424 | } |
| 425 | regex += "$"; |
| 426 | entry.ICaseRegex.compile(regex); |
| 427 | } |
| 428 | |
| 429 | this->Names.push_back(std::move(entry)); |
| 430 | } |
| 431 | |
| 432 | void cmFindLibraryHelper::SetName(std::string const& name) |
| 433 | { |
no test coverage detected