2021-03-07 02:40:21 +02:00
|
|
|
# Try to find MPFR, once done this will define:
|
2020-02-08 16:05:03 +00:00
|
|
|
#
|
|
|
|
# MPFR_FOUND - system has MPFR
|
2015-10-29 10:09:43 +02:00
|
|
|
# MPFR_INCLUDE_DIR - the MPFR include directory
|
2020-02-19 20:52:40 +00:00
|
|
|
# MPFR_LIBRARIES - the libraries needed to use MPFR
|
2020-02-08 16:05:03 +00:00
|
|
|
#
|
2021-03-07 02:40:21 +02:00
|
|
|
# Copyright (c) 2020 Ivailo Monev <xakepa10@gmail.com>
|
2015-10-29 10:09:43 +02:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
2020-02-19 20:52:40 +00:00
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
2020-02-08 16:05:03 +00:00
|
|
|
|
|
|
|
if(NOT WIN32)
|
|
|
|
include(FindPkgConfig)
|
|
|
|
pkg_check_modules(PC_MPFR QUIET mpfr)
|
2020-02-10 20:40:01 +00:00
|
|
|
|
|
|
|
set(MPFR_INCLUDE_DIR ${PC_MPFR_INCLUDE_DIRS})
|
|
|
|
set(MPFR_LIBRARIES ${PC_MPFR_LIBRARIES})
|
2020-02-08 16:05:03 +00:00
|
|
|
endif()
|
2015-10-29 10:09:43 +02:00
|
|
|
|
2020-02-18 15:53:03 +00:00
|
|
|
set(MPFR_VERSION ${PC_MPFR_VERSION})
|
|
|
|
|
2020-02-10 20:40:01 +00:00
|
|
|
if(NOT MPFR_INCLUDE_DIR OR NOT MPFR_LIBRARIES)
|
|
|
|
find_path(MPFR_INCLUDE_DIR
|
|
|
|
NAMES mpfr.h
|
|
|
|
HINTS $ENV{MPFRDIR}/include
|
|
|
|
)
|
2015-10-29 10:09:43 +02:00
|
|
|
|
2020-02-10 20:40:01 +00:00
|
|
|
find_library(MPFR_LIBRARIES
|
|
|
|
NAMES mpfr
|
|
|
|
HINTS $ENV{MPFRDIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
2015-10-29 10:09:43 +02:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-02-08 16:05:03 +00:00
|
|
|
find_package_handle_standard_args(MPFR
|
2020-02-18 15:53:03 +00:00
|
|
|
VERSION_VAR MPFR_VERSION
|
2020-02-08 16:05:03 +00:00
|
|
|
REQUIRED_VARS MPFR_LIBRARIES MPFR_INCLUDE_DIR
|
|
|
|
)
|
2015-10-29 10:09:43 +02:00
|
|
|
|
|
|
|
mark_as_advanced(MPFR_INCLUDE_DIR MPFR_LIBRARIES)
|