Split GMP_LIBRARIES into debug and release.

This commit is contained in:
Maxime Gimeno 2021-04-02 12:49:30 +02:00
parent 854fa38f11
commit 87bb3b27d1
1 changed files with 16 additions and 5 deletions

View File

@ -31,16 +31,27 @@ if( NOT GMP_in_cache )
DOC "The directory containing the GMP header files"
)
find_library(GMP_LIBRARIES NAMES gmp libgmp-10 mpir
find_library(GMP_LIBRARY_RELEASE NAMES gmp libgmp-10 mpir
HINTS ENV GMP_LIB_DIR
ENV GMP_DIR
${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/lib
PATH_SUFFIXES lib
DOC "Path to the GMP library"
DOC "Path to the Release GMP library"
)
if ( GMP_LIBRARIES )
get_filename_component(GMP_LIBRARIES_DIR ${GMP_LIBRARIES} PATH CACHE )
find_library(GMP_LIBRARY_DEBUG NAMES gmpd libgmp-10 mpir
HINTS ENV GMP_LIB_DIR
ENV GMP_DIR
${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/lib
PATH_SUFFIXES lib
DOC "Path to the Debug GMP library"
)
set(GMP_LIBRARIES "${GMP_LIBRARY_DEBUG};${GMP_LIBRARY_RELEASE}")
if ( GMP_LIBRARY_DEBUG )
get_filename_component(GMP_LIBRARIES_DIR ${GMP_LIBRARY_DEBUG} PATH CACHE )
elseif ( GMP_LIBRARY_RELEASE )
get_filename_component(GMP_LIBRARIES_DIR${GMP_LIBRARY_DEBUG} PATH CACHE )
endif()
# Attempt to load a user-defined configuration for GMP if couldn't be found