BUG: fix find library for unix

This commit is contained in:
Bill Hoffman 2001-05-11 14:39:30 -04:00
parent 1a2af3f583
commit 72a9a5546f
3 changed files with 11 additions and 9 deletions

View File

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

View File

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

View File

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