]> the.earth.li Git - onak.git/blob - cmake/FindGMP.cmake
Handle failed database initialisation more gracefully
[onak.git] / cmake / FindGMP.cmake
1 # No pkg-config support in GMP, so try and find it manually                              
2
3 set(GMP_PREFIX "" CACHE PATH "path ")
4
5 find_path(GMP_INCLUDE_DIR gmp.h gmpxx.h
6     PATHS ${GMP_PREFIX}/include /usr/include /usr/local/include)                         
7
8 find_library(GMP_LIBRARY NAMES gmp libgmp
9     PATHS ${GMP_PREFIX}/lib /usr/lib /usr/local/lib)                                     
10
11 if(GMP_INCLUDE_DIR AND GMP_LIBRARY)
12     get_filename_component(GMP_LIBRARY_DIR ${GMP_LIBRARY} PATH)                          
13     set(GMP_FOUND TRUE)
14 endif()
15
16 if(GMP_FOUND)
17    if(NOT GMP_FIND_QUIETLY)
18       MESSAGE(STATUS "Found GMP: ${GMP_LIBRARY}")                                        
19    endif()
20 elseif(GMP_FOUND)
21    if(GMP_FIND_REQUIRED)
22       message(FATAL_ERROR "Could not find GMP")                                          
23    endif()
24 endif()