]> source.dussan.org Git - tigervnc.git/commitdiff
Split gmp detection to separate module
authorPierre Ossman <ossman@cendio.se>
Thu, 1 Sep 2022 09:28:23 +0000 (11:28 +0200)
committerPierre Ossman <ossman@cendio.se>
Thu, 1 Sep 2022 12:35:39 +0000 (14:35 +0200)
It is a (weird) dependency of nettle, and not part of nettle itself. So
split it to a separate module for clarity.

cmake/Modules/FindGmp.cmake [new file with mode: 0644]
cmake/Modules/FindNettle.cmake

diff --git a/cmake/Modules/FindGmp.cmake b/cmake/Modules/FindGmp.cmake
new file mode 100644 (file)
index 0000000..c59f221
--- /dev/null
@@ -0,0 +1,9 @@
+find_package(PkgConfig)
+
+if (PKG_CONFIG_FOUND)
+  pkg_check_modules(GMP gmp)
+else()
+  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)
+endif()
index cd9b424a54e48a05b0a418f9b4638a4085619ab8..e2283c4966e8459d5b579ee24c360cfe8e3236b7 100644 (file)
@@ -1,16 +1,13 @@
+find_package(Gmp)
 find_package(PkgConfig)
 
 if (PKG_CONFIG_FOUND)
   pkg_check_modules(NETTLE nettle>=3.0)
   pkg_check_modules(HOGWEED hogweed)
-  pkg_check_modules(GMP gmp)
 else()
   find_path(NETTLE_INCLUDE_DIRS NAMES eax.h PATH_SUFFIXES nettle)
   find_library(NETTLE_LIBRARIES NAMES nettle)
   find_package_handle_standard_args(NETTLE DEFAULT_MSG NETTLE_LIBRARIES NETTLE_INCLUDE_DIRS)
-  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)
   find_library(HOGWEED_LIBRARIES NAMES hogweed)
   find_package_handle_standard_args(HOGWEED DEFAULT_MSG HOGWEED_LIBRARIES)
 endif()