Teach find_library and find_package to search lib32 paths (#11260)

Add a ``FIND_LIBRARY_USE_LIB32_PATHS`` global property analogous to the
``FIND_LIBRARY_USE_LIB64_PATHS`` property.  This helps find commands on
multilib systems that use ``lib32`` directories and either do not have
``lib`` symlinks or point ``lib`` to ``lib64``.
This commit is contained in:
Daniel Scharrer
2016-06-10 16:11:18 +02:00
committed by Brad King
parent c5d71b28ec
commit 896ad251de
28 changed files with 110 additions and 27 deletions

View File

@@ -40,11 +40,10 @@ bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn,
return true;
}
if (const char* abi_name =
this->Makefile->GetDefinition("CMAKE_INTERNAL_PLATFORM_ABI")) {
std::string abi = abi_name;
if (abi.find("ELF N32") != abi.npos) {
// Convert lib to lib32.
if (this->Makefile->GetState()->GetGlobalPropertyAsBool(
"FIND_LIBRARY_USE_LIB32_PATHS")) {
// add special 32 bit paths if this is a 32 bit compile.
if (this->Makefile->PlatformIs32Bit()) {
this->AddArchitecturePaths("32");
}
}