GMP is a new dependency.
This commit is contained in:
parent
04a8d7ddde
commit
b66755174f
@ -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
24
cmake/FindGMP.cmake
Normal 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()
|
Loading…
Reference in New Issue
Block a user