ENH: better fix for 64 bit, add 64 to the name of all directories in the search path

This commit is contained in:
Bill Hoffman 2005-04-06 11:56:04 -04:00
parent 69da19a6a7
commit 5e0a796acc
1 changed files with 13 additions and 9 deletions

View File

@ -2188,17 +2188,21 @@ std::string cmMakefile::FindLibrary(const char* name,
{ {
std::string voidsize = this->GetRequiredDefinition("CMAKE_SIZEOF_VOID_P"); std::string voidsize = this->GetRequiredDefinition("CMAKE_SIZEOF_VOID_P");
int size = atoi(voidsize.c_str()); int size = atoi(voidsize.c_str());
std::vector<std::string> path64;
if(size == 8) if(size == 8)
{ {
path.push_back("/usr/X11R6/lib64"); // add a 64 to the name of all the search paths
path.push_back("/usr/local/lib64"); for(std::vector<std::string>::iterator i = path.begin();
path.push_back("/usr/lib64"); i != path.end(); ++i)
}
if(size == 4)
{ {
path.push_back("/usr/X11R6/lib32"); std::string s = *i;
path.push_back("/usr/local/lib32"); s += "64";
path.push_back("/usr/lib32"); path64.push_back(s);
}
// now append the regular names
path64.insert(path64.end(), path.begin(), path.end());
// now look for the library in the 64 bit path
return cmSystemTools::FindLibrary(name, path64);
} }
} }
return cmSystemTools::FindLibrary(name, path); return cmSystemTools::FindLibrary(name, path);