Don't search in architecture-irrelevant directories

If we are on a 64-bits machine, there is no point in searching lib32
and conversely. Quite the opposite, it can only end badly if a library
is actually found in the wrong architecture directory.
This commit is contained in:
Roland Kaufmann
2013-03-13 10:38:27 +01:00
parent d0004fcd76
commit ac861580d7
4 changed files with 24 additions and 8 deletions

View File

@@ -115,11 +115,14 @@ function (find_opm_package module deps header lib defs prog conf)
# some modules are all in headers
if (NOT "${lib}" STREQUAL "")
if (CMAKE_SIZEOF_VOID_P)
math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}")
endif (CMAKE_SIZEOF_VOID_P)
find_library (${module}_LIBRARY
NAMES "${lib}"
PATHS ${_guess_bin}
HINTS ${${module}_DIR} ${${module}_ROOT} ${${MODULE}_ROOT} ${PkgConf_${module}_LIBRARY_DIRS}
PATH_SUFFIXES "lib" "lib/.libs" ".libs" "lib32" "lib64" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
PATH_SUFFIXES "lib" "lib/.libs" ".libs" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}"
)
else (NOT "${lib}" STREQUAL "")
set (${module}_LIBRARY "")