summaryrefslogtreecommitdiff
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorDaniel Scharrer <daniel@constexpr.org>2016-06-10 16:11:18 +0200
committerBrad King <brad.king@kitware.com>2016-06-10 11:09:16 -0400
commit896ad251de49f167f4ce3cbbcf9a6cce85a16681 (patch)
tree0acf91eea833662f1d2342b6c341aacaa7c40f2b /Source/cmFindPackageCommand.cxx
parentc5d71b28ec2682ec160dd35015e90dd5b81a5605 (diff)
downloadcmake-896ad251de49f167f4ce3cbbcf9a6cce85a16681.tar.gz
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``.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 7908afe958..1a44d73dc4 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -43,6 +43,7 @@ cmFindPackageCommand::cmFindPackageCommand()
this->UseConfigFiles = true;
this->UseFindModules = true;
this->DebugMode = false;
+ this->UseLib32Paths = false;
this->UseLib64Paths = false;
this->PolicyScope = true;
this->VersionMajor = 0;
@@ -110,6 +111,13 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
this->LibraryArchitecture = arch;
}
+ // Lookup whether lib32 paths should be used.
+ if (this->Makefile->PlatformIs32Bit() &&
+ this->Makefile->GetState()->GetGlobalPropertyAsBool(
+ "FIND_LIBRARY_USE_LIB32_PATHS")) {
+ this->UseLib32Paths = true;
+ }
+
// Lookup whether lib64 paths should be used.
if (this->Makefile->PlatformIs64Bit() &&
this->Makefile->GetState()->GetGlobalPropertyAsBool(
@@ -1907,6 +1915,9 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in)
if (!this->LibraryArchitecture.empty()) {
common.push_back("lib/" + this->LibraryArchitecture);
}
+ if (this->UseLib32Paths) {
+ common.push_back("lib32");
+ }
if (this->UseLib64Paths) {
common.push_back("lib64");
}