diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake index 381ef395d..9191cef7e 100644 --- a/Modules/Platform/HP-UX.cmake +++ b/Modules/Platform/HP-UX.cmake @@ -1,6 +1,7 @@ SET(CMAKE_SHARED_LIBRARY_SUFFIX ".sl") # .so SET(CMAKE_DL_LIBS "dld") SET(CMAKE_FIND_LIBRARY_SUFFIXES ".sl" ".so" ".a") +SET(CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES ".so") # The HP linker needs to find transitive shared library dependencies # in the -L path. Therefore the runtime path must be added to the diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 331e3fde7..058a0d4b0 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -814,6 +814,17 @@ void cmComputeLinkInformation::ComputeItemParserInfo() this->AddLinkExtension(i->c_str(), LinkUnknown); } } + if(const char* sharedSuffixes = + mf->GetDefinition("CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES")) + { + std::vector sharedSuffixVec; + cmSystemTools::ExpandListArgument(sharedSuffixes, sharedSuffixVec); + for(std::vector::iterator i = sharedSuffixVec.begin(); + i != sharedSuffixVec.end(); ++i) + { + this->AddLinkExtension(i->c_str(), LinkShared); + } + } // Compute a regex to match link extensions. std::string libext = this->CreateExtensionRegex(this->LinkExtensions); diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index cf5337b9a..32c8d6921 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -377,6 +377,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "The suffix to use for the end of a static library, .lib on Windows.", false, "Variables that Provide Information"); + cm->DefineProperty + ("CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES", cmProperty::VARIABLE, + "Additional suffixes for shared libraries.", + "Extensions for shared libraries other than that specified by " + "CMAKE_SHARED_LIBRARY_SUFFIX, if any. " + "CMake uses this to recognize external shared library files during " + "analysis of libraries linked by a target.", + false, + "Variables that Provide Information"); // Variables defined by cmake, that change the behavior