diff options
author | Brad King <brad.king@kitware.com> | 2005-04-07 18:30:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2005-04-07 18:30:48 (GMT) |
commit | 0d494a031cd1cfc32ea713d0d01d83b91ee29398 (patch) | |
tree | 1c6b235fa488bcef4169e9bc1cfda3b20ca7c9d0 /Source/cmMakefile.cxx | |
parent | 290ffc01b64d18e694a960f432ed198a8d4ab290 (diff) | |
download | CMake-0d494a031cd1cfc32ea713d0d01d83b91ee29398.zip CMake-0d494a031cd1cfc32ea713d0d01d83b91ee29398.tar.gz CMake-0d494a031cd1cfc32ea713d0d01d83b91ee29398.tar.bz2 |
ENH: Adding automatic generation of several 64-bit search path forms.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 1f5ed8a..84ccc78 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2191,16 +2191,29 @@ std::string cmMakefile::FindLibrary(const char* name, std::vector<std::string> path64; if(size == 8) { - // add a 64 to the name of all the search paths + // Convert each search path to possible 32- and 64-bit versions + // of the names. Check for the existence of each one here to + // avoid repeating the check for every file search. for(std::vector<std::string>::iterator i = path.begin(); i != path.end(); ++i) { std::string s = *i; - s += "64"; - path64.push_back(s); + std::string s2 = *i; + cmSystemTools::ReplaceString(s, "lib/", "lib64/"); + if(cmSystemTools::FileIsDirectory(s.c_str())) + { + path64.push_back(s); + } + s2 += "64"; + if(cmSystemTools::FileIsDirectory(s2.c_str())) + { + path64.push_back(s2); + } + if(cmSystemTools::FileIsDirectory(i->c_str())) + { + path64.push_back(*i); + } } - // 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); } |