summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-02 14:26:08 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2017-03-02 14:26:08 (GMT)
commit6c332bd84ce320e4163130a052af7b9950b38318 (patch)
treeb5d7f78c1d2a9d6a8d6154f8a2111455789316f6 /Source
parent5d81817b7168d16190848807d2cfb73ed14b8ee7 (diff)
parent503f25d490e56dfc1d3dc894e1fc1bd3e7e89e81 (diff)
downloadCMake-6c332bd84ce320e4163130a052af7b9950b38318.zip
CMake-6c332bd84ce320e4163130a052af7b9950b38318.tar.gz
CMake-6c332bd84ce320e4163130a052af7b9950b38318.tar.bz2
Merge topic 'find_library-custom-lib-suffix'
503f25d4 find_library: Allow custom lib suffix be used as find path
Diffstat (limited to 'Source')
-rw-r--r--Source/cmFindLibraryCommand.cxx28
1 files changed, 15 insertions, 13 deletions
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index c86f9c1..69f9078 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -43,20 +43,22 @@ bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn,
return true;
}
- 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");
- }
+ // add custom lib<qual> paths instead of using fixed lib32 or lib64
+ if (const char* customLib = this->Makefile->GetDefinition(
+ "CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX")) {
+ this->AddArchitecturePaths(customLib);
}
-
- if (this->Makefile->GetState()->GetGlobalPropertyAsBool(
- "FIND_LIBRARY_USE_LIB64_PATHS")) {
- // add special 64 bit paths if this is a 64 bit compile.
- if (this->Makefile->PlatformIs64Bit()) {
- this->AddArchitecturePaths("64");
- }
+ // add special 32 bit paths if this is a 32 bit compile.
+ else if (this->Makefile->PlatformIs32Bit() &&
+ this->Makefile->GetState()->GetGlobalPropertyAsBool(
+ "FIND_LIBRARY_USE_LIB32_PATHS")) {
+ this->AddArchitecturePaths("32");
+ }
+ // add special 64 bit paths if this is a 64 bit compile.
+ else if (this->Makefile->PlatformIs64Bit() &&
+ this->Makefile->GetState()->GetGlobalPropertyAsBool(
+ "FIND_LIBRARY_USE_LIB64_PATHS")) {
+ this->AddArchitecturePaths("64");
}
std::string library = this->FindLibrary();