summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-08-10 16:55:41 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-08-10 16:55:41 (GMT)
commite59e9d0e5972ef251157d412d4a0ae341caa379f (patch)
tree01ed394b0de6b1bd7a5d28b1afa5f14453231f72
parentb058a5e1aa8ac7c54552eff5519a9b43ab20a08d (diff)
downloadCMake-e59e9d0e5972ef251157d412d4a0ae341caa379f.zip
CMake-e59e9d0e5972ef251157d412d4a0ae341caa379f.tar.gz
CMake-e59e9d0e5972ef251157d412d4a0ae341caa379f.tar.bz2
ENH: fix bug 2087 lib prefix stripped off on windows
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx6
-rw-r--r--Source/cmLocalGenerator.cxx6
-rw-r--r--Source/cmOrderLinkDirectories.cxx14
-rw-r--r--Source/cmOrderLinkDirectories.h13
-rw-r--r--Tests/Complex/Executable/complex.cxx1
-rw-r--r--Tests/ComplexOneConfig/Executable/complex.cxx1
-rw-r--r--Tests/ComplexRelativePaths/Executable/complex.cxx1
7 files changed, 35 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
diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx
index 1a35978..43eb109 100644
--- a/Tests/Complex/Executable/complex.cxx
+++ b/Tests/Complex/Executable/complex.cxx
@@ -56,6 +56,7 @@ bool TestLibraryOrder(bool shouldFail)
orderLibs.DebugOn();
orderLibs.AddLinkExtension(".so");
orderLibs.AddLinkExtension(".a");
+ orderLibs.SetLinkPrefix("lib");
orderLibs.SetLinkInformation(target, cmTarget::GENERAL, "A");
bool ret = orderLibs.DetermineLibraryPathOrder();
orderLibs.GetLinkerInformation(sortedpaths, linkItems);
diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx
index 1a35978..43eb109 100644
--- a/Tests/ComplexOneConfig/Executable/complex.cxx
+++ b/Tests/ComplexOneConfig/Executable/complex.cxx
@@ -56,6 +56,7 @@ bool TestLibraryOrder(bool shouldFail)
orderLibs.DebugOn();
orderLibs.AddLinkExtension(".so");
orderLibs.AddLinkExtension(".a");
+ orderLibs.SetLinkPrefix("lib");
orderLibs.SetLinkInformation(target, cmTarget::GENERAL, "A");
bool ret = orderLibs.DetermineLibraryPathOrder();
orderLibs.GetLinkerInformation(sortedpaths, linkItems);
diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx
index 1a35978..43eb109 100644
--- a/Tests/ComplexRelativePaths/Executable/complex.cxx
+++ b/Tests/ComplexRelativePaths/Executable/complex.cxx
@@ -56,6 +56,7 @@ bool TestLibraryOrder(bool shouldFail)
orderLibs.DebugOn();
orderLibs.AddLinkExtension(".so");
orderLibs.AddLinkExtension(".a");
+ orderLibs.SetLinkPrefix("lib");
orderLibs.SetLinkInformation(target, cmTarget::GENERAL, "A");
bool ret = orderLibs.DetermineLibraryPathOrder();
orderLibs.GetLinkerInformation(sortedpaths, linkItems);