diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f6892a59..2592259e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ set(Required_CMake_Version 3.16.2) set(Required_Boost_Version 1.72) +set(Required_Gmp_Version 6.1.2) set(Required_Python_Version 3.9) set(Required_Gpgmepp_Version 1.13.1) @@ -218,6 +219,18 @@ macro(find_req_library_and_header _header_var _header _lib_var _lib) endmacro(find_req_library_and_header _header_var _header _lib_var _lib) find_req_library_and_header(GMP_PATH gmp.h GMP_LIB gmp) +if (GMP_PATH AND EXISTS "${GMP_PATH}/gmp.h") + file(STRINGS "${GMP_PATH}/gmp.h" gmp_header_str REGEX "^#define[\t ]+__GNU_MP_VERSION(_MINOR|_PATCHLEVEL)?[\t ]+[0-9]+") + string(REGEX REPLACE ".*#define __GNU_MP_VERSION[\t ]+([0-9]+).*" "\\1" GMP_VERSION_MAJOR "${gmp_header_str}") + string(REGEX REPLACE ".*#define __GNU_MP_VERSION_MINOR[\t ]+([0-9]+).*" "\\1" GMP_VERSION_MINOR "${gmp_header_str}") + string(REGEX REPLACE ".*#define __GNU_MP_VERSION_PATCHLEVEL[\t ]+([0-9]+).*" "\\1" GMP_VERSION_PATCH "${gmp_header_str}") + unset(gmp_header_str) + set(GMP_VERSION_STRING "${GMP_VERSION_MAJOR}.${GMP_VERSION_MINOR}.${GMP_VERSION_PATCH}") + if ("${GMP_VERSION_STRING}" VERSION_LESS ${Required_Gmp_Version}) + message(FATAL_ERROR "Ledger requires GMP version ${Expected_Gmp_Version} or greater, but only GMP version ${GMP_VERSION_STRING} was found") + endif() +endif() + find_req_library_and_header(MPFR_PATH mpfr.h MPFR_LIB mpfr) check_library_exists(edit readline "" HAVE_EDIT) |