Merge topic 'link-OpenBSD-shared-libs-issue-12954'

afc75bb Recognize OpenBSD versioned .so names (#12954)
This commit is contained in:
David Cole 2012-02-21 15:53:41 -05:00 committed by CMake Topic Stage
commit e1a6c9b9a1
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);