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