Recognize OpenBSD versioned .so names (#12954)

OpenBSD shared library names end in a ".#.#" version number suffix.
Teach cmComputeLinkInformation to tolerate the extra suffix after
the normal library name suffixes when parsing library names.
This commit is contained in:
Brad King 2012-02-13 10:33:27 -05:00
parent 16b1a6e4e0
commit afc75bb7f5
2 changed files with 14 additions and 1 deletions

View File

@ -248,6 +248,10 @@ cmComputeLinkInformation
this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance();
// Check whether to recognize OpenBSD-style library versioned names.
this->OpenBSD = this->Makefile->GetCMakeInstance()
->GetPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING");
// The configuration being linked.
this->Config = config;
@ -973,7 +977,15 @@ cmComputeLinkInformation
}
// Finish the list.
libext += ")$";
libext += ")";
// Add an optional OpenBSD version component.
if(this->OpenBSD)
{
libext += "(\\.[0-9]+\\.[0-9]+)?";
}
libext += "$";
return libext;
}

View File

@ -128,6 +128,7 @@ private:
cmsys::RegularExpression ExtractSharedLibraryName;
cmsys::RegularExpression ExtractAnyLibraryName;
std::string SharedRegexString;
bool OpenBSD;
void AddLinkPrefix(const char* p);
void AddLinkExtension(const char* e, LinkType type);
std::string CreateExtensionRegex(std::vector<std::string> const& exts);