hard to find
This commit is contained in:
parent
396bd2f8c3
commit
7312765824
@ -1,61 +1,48 @@
|
||||
# vim: set ts=2 shiftwidth=2 expandtab:
|
||||
#
|
||||
# - Find GMP/MPIR libraries and headers
|
||||
# This module defines the following variables:
|
||||
#
|
||||
# GMP_FOUND - true if GMP/MPIR was found
|
||||
# GMP_INCLUDE_DIRS - include search path
|
||||
# GMP_LIBARIES - libraries to link with
|
||||
# GMP_LIBARY_DLL - library DLL to install. Only available on WIN32.
|
||||
# GMP_LIBRARIES - libraries to link with
|
||||
# GMP_LIBRARY_DLL - library DLL to install. Only available on WIN32.
|
||||
# GMP_LIBRARIES_DIR - the directory the library we link with is found in.
|
||||
|
||||
find_path(GMP_INCLUDE_DIRS NAMES gmp.h
|
||||
PATHS "${GMP_DIR}/include" "${GMP_DIR}" "$ENV{PROGRAMFILES}/mpir/include"
|
||||
DOC "The gmp include directory"
|
||||
)
|
||||
|
||||
if(MVC)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND MSVC)
|
||||
set(MPIR_LIB "mpird")
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(GMP_NAME "mpird")
|
||||
else()
|
||||
set(MPIR_LIB "mpir")
|
||||
set(GMP_NAME "mpir")
|
||||
endif()
|
||||
else()
|
||||
set(GMP_NAME gmp)
|
||||
endif()
|
||||
|
||||
find_library(GMP_LIBRARIES NAMES ${MPIR_LIB}
|
||||
PATHS "$ENV{PROGRAMFILES}/mpir/lib"
|
||||
DOC "The MPIR library"
|
||||
find_path(GMP_INCLUDE_DIRS
|
||||
NAMES ${GMP_NAME}.h
|
||||
PATHS $ENV{GMP_ROOT}/include
|
||||
$ENV{PROGRAMFILES}/mpir/include
|
||||
)
|
||||
|
||||
find_library(GMP_LIBRARIES NAMES ${GMP_NAME}
|
||||
PATHS $ENV{GMP_ROOT} $ENV{PROGRAMFILES}/mpir/lib $ENV{GMP_ROOT}/lib ${CMAKE_INSTALL_PREFIX}/lib
|
||||
)
|
||||
find_library(GMP_LIBRARY_DLL NAMES ${MPIR_LIB}
|
||||
|
||||
find_library(GMP_LIBRARY_DLL NAMES ${GMP_NAME}
|
||||
PATHS "$ENV{PROGRAMFILES}/mpir/bin"
|
||||
DOC "The MPIR library DLL"
|
||||
)
|
||||
else(MVC)
|
||||
find_library(GMP_LIBRARIES NAMES gmp
|
||||
PATHS "${GMP_DIR}/lib"
|
||||
DOC "The GMP library"
|
||||
)
|
||||
find_library(GMP_LIBRARIES NAMES gmp
|
||||
PATHS "${GMP_DIR}"
|
||||
DOC "The GMP library"
|
||||
)
|
||||
find_library(GMP_LIBRARIES NAMES gmp
|
||||
PATHS "${CMAKE_INSTALL_PREFIX}/lib"
|
||||
DOC "The GMP library"
|
||||
)
|
||||
if(WIN32)
|
||||
find_library(GMP_LIBRARY_DLL NAMES gmp
|
||||
PATHS "${CMAKE_INSTALL_PREFIX}/bin" "${GMP_DIR}/bin" "${GMP_DIR}"
|
||||
DOC "The GMP library DLL"
|
||||
)
|
||||
endif()
|
||||
endif(MVC)
|
||||
|
||||
get_filename_component(GMP_LIBRARIES_DIR "${GMP_LIBRARIES}" PATH)
|
||||
get_filename_component(GMP_LIBRARIES_DIR "${GMP_LIBRARIES}" PATH CACHE)
|
||||
|
||||
# handle the QUIET and REQUIRED arguments and set GMP_FOUND to TRUE if
|
||||
# all listed variables are true
|
||||
include(FindPackageHandleStandardArgs)
|
||||
if(WIN32)
|
||||
find_package_handle_standard_args(GMP DEFAULT_MSG GMP_LIBRARIES GMP_LIBRARY_DLL GMP_INCLUDE_DIRS)
|
||||
find_package_handle_standard_args(GMP DEFAULT_MSG GMP_LIBRARIES GMP_LIBRARIES_DIR GMP_LIBRARY_DLL GMP_INCLUDE_DIRS)
|
||||
else()
|
||||
find_package_handle_standard_args(GMP DEFAULT_MSG GMP_LIBRARIES GMP_INCLUDE_DIRS)
|
||||
find_package_handle_standard_args(GMP DEFAULT_MSG GMP_LIBRARIES GMP_LIBRARIES_DIR GMP_INCLUDE_DIRS)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(GMP_LIBRARIES GMP_LIBRARIES_DIR GMP_INCLUDE_DIRS)
|
||||
|
Reference in New Issue
Block a user