Explorar o código

BUG: fix find library for unix

Bill Hoffman %!s(int64=25) %!d(string=hai) anos
pai
achega
72a9a5546f

+ 0 - 2
Source/cmCableSourceFilesCommand.cxx

@@ -75,8 +75,6 @@ void cmCableSourceFilesCommand::WriteConfiguration() const
   std::ostream& os = m_CableData->GetOutputStream();
   cmCableData::Indentation indent = m_CableData->GetIndentation();
   
-  cmRegularExpression needCdataBlock("[&<>]");
-  
   os << indent << "<Headers>" << std::endl;
   for(Entries::const_iterator f = m_Entries.begin();
       f != m_Entries.end(); ++f)

+ 6 - 7
Source/cmSystemTools.cxx

@@ -687,7 +687,7 @@ bool cmSystemTools::RunCommand(const char* command,
   fgets(buffer, BUFFER_SIZE, cpipe);
   while(!feof(cpipe))
     {
-    std::cout << buffer;
+    std::cout << buffer << std::flush;
     output += buffer;
     fgets(buffer, BUFFER_SIZE, cpipe);
     }
@@ -779,23 +779,23 @@ std::string cmSystemTools::FindLibrary(const char* name,
     tryPath = *p;
     tryPath += "/lib";
     tryPath += name;
-    tryPath + ".so";
+    tryPath += ".so";
     if(cmSystemTools::FileExists(tryPath.c_str()))
       {
       return cmSystemTools::CollapseFullPath(tryPath.c_str());
       }
     tryPath = *p;
-    tryPath = "/lib";
+    tryPath += "/lib";
     tryPath += name;
-    tryPath + ".a";
+    tryPath += ".a";
     if(cmSystemTools::FileExists(tryPath.c_str()))
       {
       return cmSystemTools::CollapseFullPath(tryPath.c_str());
       }
     tryPath = *p;
-    tryPath = "/lib";
+    tryPath += "/lib";
     tryPath += name;
-    tryPath + ".sl";
+    tryPath += ".sl";
     if(cmSystemTools::FileExists(tryPath.c_str()))
       {
       return cmSystemTools::CollapseFullPath(tryPath.c_str());
@@ -886,7 +886,6 @@ void cmSystemTools::SplitProgramPath(const char* in_name,
  */
 std::string cmSystemTools::CollapseFullPath(const char* in_name)
 {
-  std::cerr << "CollapseFullPath " << in_name << "\n";
   std::string dir, file;
   cmSystemTools::SplitProgramPath(in_name, dir, file);
   // Ultra-hack warning:

+ 5 - 0
Source/cmUnixMakefileGenerator.cxx

@@ -193,6 +193,7 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
     }
   std::string librariesLinked;
   const cmTarget::LinkLibraries& libs = tgt.GetLinkLibraries();
+  cmRegularExpression reg("lib(.*)(\\.so$|\\.a|\\.sl$)");
   for(cmTarget::LinkLibraries::const_iterator lib = libs.begin();
       lib != libs.end(); ++lib)
     {
@@ -210,6 +211,10 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
       linkLibs += cmSystemTools::EscapeSpaces(dir.c_str());
       linkLibs += " ";
       librariesLinked += "-l";
+      if(reg.find(file))
+        {
+        file = reg.match(1);
+        }
       librariesLinked += file;
       librariesLinked += " ";
       }