GMP is a new dependency.

This commit is contained in:
Nicolás A. Ortega 2016-12-02 16:31:12 +01:00
parent 04a8d7ddde
commit b66755174f
No known key found for this signature in database
GPG Key ID: 614272579C2070D1
2 changed files with 29 additions and 0 deletions

View File

@ -9,7 +9,12 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${CMAKE_SOURCE_DIR}/cmake/)
find_package(OpenMP REQUIRED)
find_package(GMP REQUIRED)
set(SRCS
src/Main.cpp)

24
cmake/FindGMP.cmake Normal file
View File

@ -0,0 +1,24 @@
# 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()