You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.4 KiB

  1. # - Try to find libcln
  2. # Once done this will define
  3. # CLN_FOUND - System has cln
  4. # CLN_INCLUDE_DIR - The cln include directory
  5. # CLN_LIBRARIES - The libraries needed to use cln
  6. # CLN_VERSION_STRING - The version of cln ("major.minor.patch")
  7. # use pkg-config to get the directories and then use these values
  8. # in the find_path() and find_library() calls
  9. find_package(PkgConfig QUIET)
  10. PKG_CHECK_MODULES(PC_CLN QUIET cln)
  11. find_path(CLN_INCLUDE_DIR NAMES cln/cln.h
  12. HINTS
  13. ${PC_CLN_INCLUDEDIR}
  14. ${PC_CLN_INCLUDE_DIRS}
  15. PATH_SUFFIXES cln
  16. )
  17. find_library(CLN_LIBRARIES NAMES cln
  18. HINTS
  19. ${PC_CLN_LIBDIR}
  20. ${PC_CLN_LIBRARY_DIRS}
  21. )
  22. if(PC_CLN_VERSION)
  23. set(CLN_VERSION_STRING ${PC_CLN_VERSION})
  24. elseif(CLN_INCLUDE_DIR AND EXISTS "${CLN_INCLUDE_DIR}/version.h")
  25. file(STRINGS "${CLN_INCLUDE_DIR}/version.h" cln_version
  26. REGEX "^#define[\t ]+CL_VERSION[\t ]+.+")
  27. string(REGEX REPLACE "^#define[\t ]+CL_VERSION[\t ]+(.+)" "\\1"
  28. CLN_VERSION_STRING "${cln_version}")
  29. unset(cln_version)
  30. endif()
  31. # handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
  32. # all listed variables are TRUE
  33. include(FindPackageHandleStandardArgs)
  34. FIND_PACKAGE_HANDLE_STANDARD_ARGS(CLN
  35. REQUIRED_VARS CLN_LIBRARIES CLN_INCLUDE_DIR
  36. VERSION_VAR CLN_VERSION_STRING)
  37. mark_as_advanced(CLN_INCLUDE_DIR CLN_LIBRARIES)