Also call find_library once for each name when searching the release library.

metadata
Edgar Velazquez-Armendariz 2014-01-25 21:27:52 -05:00
parent 607ccfc3ce
commit 4d1ee31304
1 changed files with 9 additions and 8 deletions

View File

@ -99,12 +99,14 @@ macro(FIND_RELEASE_AND_DEBUG)
message(FATAL_ERROR "Missing custom debug suffixes") message(FATAL_ERROR "Missing custom debug suffixes")
endif() endif()
find_library(${LIBPREFIX}_LIBRARY_RELEASE # CMake hangs if the list of library names is too long. As of CMake 2.8.11
NAMES ${LIBRELDBG_NAMES} # it is far faster to call find_library many times with a single library name
HINTS ${LIBRELDBG_PATHS} foreach(name ${LIBRELDBG_NAMES})
PATHS ${LIBRELDBG_FIXED_PATHS} find_library(${LIBPREFIX}_LIBRARY_RELEASE "${name}"
PATH_SUFFIXES lib HINTS ${LIBRELDBG_PATHS}
) PATHS ${LIBRELDBG_FIXED_PATHS}
PATH_SUFFIXES lib)
endforeach()
# Use a single debug name is the release version has been found # Use a single debug name is the release version has been found
if (${LIBPREFIX}_LIBRARY_RELEASE) if (${LIBPREFIX}_LIBRARY_RELEASE)
@ -118,8 +120,7 @@ macro(FIND_RELEASE_AND_DEBUG)
endif() endif()
endif() endif()
# CMake hangs if the list of library names is too long. As of CMake 2.8.11 # Idem
# it is far faster to call find_library many times with a single library name
foreach(suffix ${LIBRELDBG_DBG_SUFFIXES}) foreach(suffix ${LIBRELDBG_DBG_SUFFIXES})
foreach(name ${LIBRELDBG_NAMES}) foreach(name ${LIBRELDBG_NAMES})
find_library(${LIBPREFIX}_LIBRARY_DEBUG "${name}${suffix}" find_library(${LIBPREFIX}_LIBRARY_DEBUG "${name}${suffix}"