summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-05-21 19:13:10 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-05-21 19:13:10 (GMT)
commit52f9b2e803caeb9f27e690bd8f4d96ff467517ab (patch)
tree3f249ab2184da2fb81661151a90520967fda6e30 /Source
parent02ba8029775c507cc9e93084aeb289d4b791e6d4 (diff)
parent342fc0401005decc9b5b87168483d7b3818ae0af (diff)
downloadCMake-52f9b2e803caeb9f27e690bd8f4d96ff467517ab.zip
CMake-52f9b2e803caeb9f27e690bd8f4d96ff467517ab.tar.gz
CMake-52f9b2e803caeb9f27e690bd8f4d96ff467517ab.tar.bz2
Merge topic 'shared-libs-with-number-suffix'
342fc04 Recognize shared library files with a numerical suffix
Diffstat (limited to 'Source')
-rw-r--r--Source/cmComputeLinkInformation.cxx14
-rw-r--r--Source/cmComputeLinkInformation.h3
2 files changed, 12 insertions, 5 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 896b50a..0158508 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -882,7 +882,8 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
}
// Compute a regex to match link extensions.
- std::string libext = this->CreateExtensionRegex(this->LinkExtensions);
+ std::string libext = this->CreateExtensionRegex(this->LinkExtensions,
+ LinkUnknown);
// Create regex to remove any library extension.
std::string reg("(.*)");
@@ -916,7 +917,8 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
if(!this->StaticLinkExtensions.empty())
{
std::string reg_static = reg;
- reg_static += this->CreateExtensionRegex(this->StaticLinkExtensions);
+ reg_static += this->CreateExtensionRegex(this->StaticLinkExtensions,
+ LinkStatic);
#ifdef CM_COMPUTE_LINK_INFO_DEBUG
fprintf(stderr, "static regex [%s]\n", reg_static.c_str());
#endif
@@ -928,7 +930,7 @@ void cmComputeLinkInformation::ComputeItemParserInfo()
{
std::string reg_shared = reg;
this->SharedRegexString =
- this->CreateExtensionRegex(this->SharedLinkExtensions);
+ this->CreateExtensionRegex(this->SharedLinkExtensions, LinkShared);
reg_shared += this->SharedRegexString;
#ifdef CM_COMPUTE_LINK_INFO_DEBUG
fprintf(stderr, "shared regex [%s]\n", reg_shared.c_str());
@@ -966,7 +968,7 @@ void cmComputeLinkInformation::AddLinkExtension(const char* e, LinkType type)
//----------------------------------------------------------------------------
std::string
cmComputeLinkInformation
-::CreateExtensionRegex(std::vector<std::string> const& exts)
+::CreateExtensionRegex(std::vector<std::string> const& exts, LinkType type)
{
// Build a list of extension choices.
std::string libext = "(";
@@ -995,6 +997,10 @@ cmComputeLinkInformation
{
libext += "(\\.[0-9]+\\.[0-9]+)?";
}
+ else if(type == LinkShared)
+ {
+ libext += "(\\.[0-9]+)?";
+ }
libext += "$";
return libext;
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index 1a76922..e6ee871 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -134,7 +134,8 @@ private:
bool OpenBSD;
void AddLinkPrefix(const char* p);
void AddLinkExtension(const char* e, LinkType type);
- std::string CreateExtensionRegex(std::vector<std::string> const& exts);
+ std::string CreateExtensionRegex(std::vector<std::string> const& exts,
+ LinkType type);
std::string NoCaseExpression(const char* str);
// Handling of link items.