From SGOrava, 2 Months ago, written in CMake.
This paste will shuffle off the mortal coil in 8 Months.
Embed
  1. # - Try to find nettle
  2. # Once done this will define
  3. #  NETTLE_FOUND - System has nettle
  4. #  NETTLE_INCLUDE_DIRS - The nettle include directories
  5. #  NETTLE_LIBRARIES - The libraries needed to use nettle
  6. #  NETTLE_DEFINITIONS - Compiler switches required for using nettle
  7.  
  8. find_package(PkgConfig)
  9. pkg_check_modules(PC_NETTLE QUIET nettle)
  10. set(NETTLE_DEFINITIONS ${PC_NETTLE_CFLAGS_OTHER})
  11.  
  12. find_path(NETTLE_INCLUDE_DIR nettle
  13.           HINTS ${PC_NETTLE_INCLUDEDIR} ${PC_NETTLE_INCLUDE_DIRS}
  14.           PATH_SUFFIXES nettle )
  15.  
  16. find_library(NETTLE_LIBRARY NAMES nettle
  17.              HINTS ${PC_NETTLE_LIBDIR} ${PC_NETTLE_LIBRARY_DIRS} )
  18.  
  19. set(NETTLE_LIBRARIES ${NETTLE_LIBRARY} )
  20. set(NETTLE_INCLUDE_DIRS ${NETTLE_INCLUDE_DIR} )
  21.  
  22. include(FindPackageHandleStandardArgs)
  23. # handle the QUIETLY and REQUIRED arguments and set NETTLE_FOUND to TRUE
  24. # if all listed variables are TRUE
  25. find_package_handle_standard_args(nettle  DEFAULT_MSG
  26.                                   NETTLE_LIBRARY NETTLE_INCLUDE_DIR)
  27. mark_as_advanced(NETTLE_INCLUDE_DIR NETTLE_LIBRARY )
  28.