summaryrefslogtreecommitdiffstats
path: root/Modules/FindPkgConfig.cmake
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/FindPkgConfig.cmake
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/FindPkgConfig.cmake')
-rw-r--r--Modules/FindPkgConfig.cmake8
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 644687c..33290c4 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -316,9 +316,13 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
list(APPEND _lib_dirs "lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig")
endif()
else()
- # not debian, chech the FIND_LIBRARY_USE_LIB64_PATHS property
+ # not debian, check the FIND_LIBRARY_USE_LIB32_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties
+ get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS)
+ if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
+ list(APPEND _lib_dirs "lib32/pkgconfig")
+ endif()
get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
- if(uselib64)
+ if(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
list(APPEND _lib_dirs "lib64/pkgconfig")
endif()
endif()