summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
diff options
context:
space:
mode:
authorDaniel Scharrer <daniel@constexpr.org>2016-06-10 14:11:18 (GMT)
committerBrad King <brad.king@kitware.com>2016-06-10 15:09:16 (GMT)
commit896ad251de49f167f4ce3cbbcf9a6cce85a16681 (patch)
tree0acf91eea833662f1d2342b6c341aacaa7c40f2b /Modules/Platform
parentc5d71b28ec2682ec160dd35015e90dd5b81a5605 (diff)
downloadCMake-896ad251de49f167f4ce3cbbcf9a6cce85a16681.zip
CMake-896ad251de49f167f4ce3cbbcf9a6cce85a16681.tar.gz
CMake-896ad251de49f167f4ce3cbbcf9a6cce85a16681.tar.bz2
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 'Modules/Platform')
-rw-r--r--Modules/Platform/Linux.cmake3
-rw-r--r--Modules/Platform/OpenBSD.cmake1
-rw-r--r--Modules/Platform/UnixPaths.cmake3
3 files changed, 5 insertions, 2 deletions
diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake
index e40a74f..1f8c1b4 100644
--- a/Modules/Platform/Linux.cmake
+++ b/Modules/Platform/Linux.cmake
@@ -50,8 +50,9 @@ set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_
include(Platform/UnixPaths)
-# Debian has lib64 paths only for compatibility so they should not be
+# Debian has lib32 and lib64 paths only for compatibility so they should not be
# searched.
if(NOT CMAKE_CROSSCOMPILING AND EXISTS "/etc/debian_version")
+ set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS FALSE)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
endif()
diff --git a/Modules/Platform/OpenBSD.cmake b/Modules/Platform/OpenBSD.cmake
index 7ac6c7e..6466a0a 100644
--- a/Modules/Platform/OpenBSD.cmake
+++ b/Modules/Platform/OpenBSD.cmake
@@ -18,6 +18,7 @@ endif()
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_OPENBSD_VERSIONING 1)
# OpenBSD has no multilib
+set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS FALSE)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
# OpenBSD policy requires that shared libraries be installed without
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index 20ee1d1..d6c3d41 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -93,5 +93,6 @@ list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
/usr/include
)
-# Enable use of lib64 search path variants by default.
+# Enable use of lib32 and lib64 search path variants by default.
+set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS TRUE)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)