]> source.dussan.org Git - tigervnc.git/commitdiff
Add fallback for finding gmp
authorPierre Ossman <ossman@cendio.se>
Thu, 1 Sep 2022 09:30:51 +0000 (11:30 +0200)
committerPierre Ossman <ossman@cendio.se>
Thu, 1 Sep 2022 12:35:39 +0000 (14:35 +0200)
pkg-config support was added very recently to gmp, so a lot of platforms
we want to support won't find gmp this way.

cmake/Modules/FindGmp.cmake

index c59f2219460cd9cf5cde4ab52ca61a766947072d..d0ccd3cdf684c85b330de83cdf81627f67dee6aa 100644 (file)
@@ -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)