aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/Modules
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2022-09-01 11:30:51 +0200
committerPierre Ossman <ossman@cendio.se>2022-09-01 14:35:39 +0200
commitab8626a54db2d381404471aa296f742144317f62 (patch)
treed254374fcff782abb24980aaa349fa4495d4384a /cmake/Modules
parent7b32549083bc41ceca0de55036b597e7ad3a4cd3 (diff)
downloadtigervnc-ab8626a54db2d381404471aa296f742144317f62.tar.gz
tigervnc-ab8626a54db2d381404471aa296f742144317f62.zip
Add fallback for finding gmp
pkg-config support was added very recently to gmp, so a lot of platforms we want to support won't find gmp this way.
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/FindGmp.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmake/Modules/FindGmp.cmake b/cmake/Modules/FindGmp.cmake
index c59f2219..d0ccd3cd 100644
--- a/cmake/Modules/FindGmp.cmake
+++ b/cmake/Modules/FindGmp.cmake
@@ -2,7 +2,11 @@ find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(GMP gmp)
-else()
+endif()
+
+# Only very recent versions of gmp has pkg-config support, so we have to
+# fall back on a more classical search
+if(NOT GMP_FOUND)
find_path(GMP_INCLUDE_DIRS NAMES gmp.h PATH_SUFFIXES)
find_library(GMP_LIBRARIES NAMES gmp)
find_package_handle_standard_args(GMP DEFAULT_MSG GMP_LIBRARIES GMP_INCLUDE_DIRS)