myx-cmake/MyxCMake/find/FindMPFR.cmake

33 lines
891 B
CMake
Raw Normal View History

2021-12-08 11:32:04 +00:00
# Copyright (c) 2008-2010 Kent State University
# Copyright (c) 2011-2012 Texas A&M University
#
# This file is distributed under the MIT License. See the accompanying file
# LICENSE.txt or http://www.opensource.org/licenses/mit-license.php for terms
# and conditions.
# NOTE: MPFR prefix is understood to be the path to the root of the MPFR
# installation library.
set(MPFR_PREFIX "" CACHE PATH "The path to the prefix of an MPFR installation")
find_path(MPFR_INCLUDE_DIRS mpfr.h
PATHS ${MPFR_PREFIX}/include)
find_library(MPFR_LIBRARIES NAMES mpfr
PATHS ${MPFR_PREFIX}/lib)
if(MPFR_INCLUDE_DIRS AND MPFR_LIBRARIES)
set(MPFR_FOUND TRUE)
endif()
if(MPFR_FOUND)
if(NOT MPFR_FIND_QUIETLY)
MESSAGE(STATUS "Found MPFR: ${MPFR_LIBRARIES}")
endif()
set(HAVE_MPFR 1)
elseif(MPFR_FOUND)
if(MPFR_FIND_REQUIRED)
message(FATAL_ERROR "Could not find MPFR")
endif()
endif()