indivisible-legacy/cmake/FindGMP.cmake

25 lines
630 B
CMake
Raw Normal View History

2016-12-02 15:31:12 +00:00
# SOURCE: http://stackoverflow.com/questions/29307862/error-linking-gmp-library
set(GMP_PREFIX "" CACHE PATH "path ")
find_path(GMP_INCLUDE_DIR gmp.h gmpxx.h
PATHS ${GMP_PREFIX}/include /usr/include /usr/local/include )
find_library(GMP_LIBRARY NAMES gmp libgmp
PATHS ${GMP_PREFIX}/lib /usr/lib /usr/local/lib)
if(GMP_INCLUDE_DIR AND GMP_LIBRARY)
get_filename_component(GMP_LIBRARY_DIR ${GMP_LIBRARY} PATH)
set(GMP_FOUND TRUE)
endif()
if(GMP_FOUND)
if(NOT GMP_FIND_QUIETLY)
MESSAGE(STATUS "Found GMP: ${GMP_LIBRARY}")
endif()
else()
if(GMP_FIND_REQUIRED)
message(FATAL_ERROR "Could not find GMP")
endif()
endif()