summaryrefslogtreecommitdiffstats
path: root/Source/cmFindBase.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-06-08 12:46:31 (GMT)
committerBrad King <brad.king@kitware.com>2011-06-08 14:04:44 (GMT)
commitb41ad3b399c591f8f35eaacf056ffd9016b9e0bc (patch)
tree5d44f207b90ac15c1ed6b34358cdfe62e7e9ca27 /Source/cmFindBase.cxx
parent0f939ee16478ad638bb380a75b4867b072a09306 (diff)
downloadCMake-b41ad3b399c591f8f35eaacf056ffd9016b9e0bc.zip
CMake-b41ad3b399c591f8f35eaacf056ffd9016b9e0bc.tar.gz
CMake-b41ad3b399c591f8f35eaacf056ffd9016b9e0bc.tar.bz2
Teach find_(library|package) about Linux multiarch (#12037)
Implement support for multiarch as specified here: http://wiki.debian.org/Multiarch https://wiki.ubuntu.com/MultiarchSpec Detect the <arch> part of <prefix>/lib/<arch> from the implicit library search path from each compiler to set CMAKE_<lang>_LIBRARY_ARCHITECTURE. Define CMAKE_LIBRARY_ARCHITECTURE using one of these values (they should all be the same). Teach the find_library and find_package commands to search <prefix>/lib/<arch> whenever they would search <prefix>/lib.
Diffstat (limited to 'Source/cmFindBase.cxx')
-rw-r--r--Source/cmFindBase.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index d0fe99f..ce9deb1 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -72,12 +72,14 @@ void cmFindBase::GenerateDocumentation()
"1. Search paths specified in cmake-specific cache variables. "
"These are intended to be used on the command line with a -DVAR=value. "
"This can be skipped if NO_CMAKE_PATH is passed.\n"
+ "XXX_EXTRA_PREFIX_ENTRY"
" <prefix>/XXX_SUBDIR for each <prefix> in CMAKE_PREFIX_PATH\n"
" CMAKE_XXX_PATH\n"
" CMAKE_XXX_MAC_PATH\n"
"2. Search paths specified in cmake-specific environment variables. "
"These are intended to be set in the user's shell configuration. "
"This can be skipped if NO_CMAKE_ENVIRONMENT_PATH is passed.\n"
+ "XXX_EXTRA_PREFIX_ENTRY"
" <prefix>/XXX_SUBDIR for each <prefix> in CMAKE_PREFIX_PATH\n"
" CMAKE_XXX_PATH\n"
" CMAKE_XXX_MAC_PATH\n"
@@ -92,6 +94,7 @@ void cmFindBase::GenerateDocumentation()
"5. Search cmake variables defined in the Platform files "
"for the current system. This can be skipped if NO_CMAKE_SYSTEM_PATH "
"is passed.\n"
+ "XXX_EXTRA_PREFIX_ENTRY"
" <prefix>/XXX_SUBDIR for each <prefix> in CMAKE_SYSTEM_PREFIX_PATH\n"
" CMAKE_SYSTEM_XXX_PATH\n"
" CMAKE_SYSTEM_XXX_MAC_PATH\n"
@@ -346,6 +349,15 @@ void cmFindBase::AddPrefixPaths(std::vector<std::string> const& in_paths,
{
dir += "/";
}
+ if(subdir == "lib")
+ {
+ const char* arch =
+ this->Makefile->GetDefinition("CMAKE_LIBRARY_ARCHITECTURE");
+ if(arch && *arch)
+ {
+ this->AddPathInternal(dir+"lib/"+arch, pathType);
+ }
+ }
std::string add = dir + subdir;
if(add != "/")
{