diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmOrderLinkDirectories.cxx | 14 | ||||
-rw-r--r-- | Source/cmOrderLinkDirectories.h | 13 |
4 files changed, 32 insertions, 7 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 2a65433..c98f5c0 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1353,6 +1353,12 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) orderLibs.AddLinkExtension(ext.c_str()); } ext = + m_CurrentMakefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_PREFIX"); + if(ext.size()) + { + orderLibs.SetLinkPrefix(ext.c_str()); + } + ext = m_CurrentMakefile->GetSafeDefinition("CMAKE_SHARED_LIBRARY_SUFFIX"); if(ext.size()) { diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 55249f2..2433414 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1286,6 +1286,12 @@ void cmLocalGenerator::OutputLinkLibraries(std::ostream& fout, orderLibs.AddLinkExtension(ext.c_str()); } ext = + m_Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_PREFIX"); + if(ext.size()) + { + orderLibs.SetLinkPrefix(ext.c_str()); + } + ext = m_Makefile->GetSafeDefinition("CMAKE_SHARED_LIBRARY_SUFFIX"); if(ext.size()) { diff --git a/Source/cmOrderLinkDirectories.cxx b/Source/cmOrderLinkDirectories.cxx index afc7a5c..96ece46 100644 --- a/Source/cmOrderLinkDirectories.cxx +++ b/Source/cmOrderLinkDirectories.cxx @@ -115,17 +115,23 @@ void cmOrderLinkDirectories::CreateRegularExpressions() } first = false; libext += "\\"; -#ifndef _WIN32 - libext += *i; -#else +#if defined(_WIN32) && !defined(__CYGWIN__) libext += this->NoCaseExpression(i->c_str()); +#else + libext += *i; #endif } libext += ").*"; cmStdString reg("(.*)"); reg += libext; m_RemoveLibraryExtension.compile(reg.c_str()); - reg = "^lib([^/]*)"; + reg = ""; + if(m_LinkPrefix.size()) + { + reg = "^"; + reg += m_LinkPrefix; + } + reg += "([^/]*)"; reg += libext; m_ExtractBaseLibraryName.compile(reg.c_str()); reg = "([^/]*)"; diff --git a/Source/cmOrderLinkDirectories.h b/Source/cmOrderLinkDirectories.h index 6fdf3de..b514081 100644 --- a/Source/cmOrderLinkDirectories.h +++ b/Source/cmOrderLinkDirectories.h @@ -64,9 +64,14 @@ public: // CMAKE_SHARED_LIBRARY_SUFFIX // CMAKE_LINK_LIBRARY_SUFFIX void AddLinkExtension(const char* e) - { - m_LinkExtensions.push_back(e); - } + { + m_LinkExtensions.push_back(e); + } + // should be set from CMAKE_STATIC_LIBRARY_PREFIX + void SetLinkPrefix(const char* s) + { + m_LinkPrefix = s; + } // Return any warnings if the exist std::string GetWarnings(); // return a list of all full path libraries @@ -120,6 +125,8 @@ private: std::set<cmStdString> m_LinkPathSet; // the names of link extensions std::vector<cmStdString> m_LinkExtensions; + // the names of link prefixes + cmStdString m_LinkPrefix; // set of directories that can not be put in the correct order std::set<cmStdString> m_ImposibleDirectories; // library regular expressions |