aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/Modules/FindNettle.cmake
blob: f5acf6acf37421fd0188165ecf26fbac610a3f4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
find_package(Gmp)
find_package(PkgConfig)

if (PKG_CONFIG_FOUND)
  pkg_check_modules(NETTLE nettle>=3.0)
  pkg_check_modules(HOGWEED hogweed)
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_library(HOGWEED_LIBRARIES NAMES hogweed)
  find_package_handle_standard_args(HOGWEED DEFAULT_MSG HOGWEED_LIBRARIES)
endif()

if (NOT HOGWEED_FOUND OR NOT GMP_FOUND)
  set(NETTLE_FOUND 0)
endif()

if(Nettle_FIND_REQUIRED AND NOT NETTLE_FOUND)
	message(FATAL_ERROR "Could not find Nettle")
endif()