MCPcopy Create free account
hub / github.com/Kitware/CMake / HasValidSuffix

Method HasValidSuffix

Source/cmFindLibraryCommand.cxx:377–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375}
376
377bool cmFindLibraryHelper::HasValidSuffix(std::string const& name)
378{
379 for (std::string suffix : this->Suffixes) {
380 if (name.length() <= suffix.length()) {
381 continue;
382 }
383 // Check if the given name ends in a valid library suffix.
384 if (name.substr(name.size() - suffix.length()) == suffix) {
385 return true;
386 }
387 // Check if a valid library suffix is somewhere in the name,
388 // this may happen e.g. for versioned shared libraries: libfoo.so.2
389 suffix += ".";
390 if (name.find(suffix) != std::string::npos) {
391 return true;
392 }
393 }
394 return false;
395}
396
397void cmFindLibraryHelper::AddName(std::string const& name)
398{

Callers 1

AddNameMethod · 0.95

Calls 4

lengthMethod · 0.80
substrMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected