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.

38 lines
770 B

2 months ago
  1. # Include dir
  2. find_path(CLN_INCLUDE_DIR
  3. NAMES cln/cln.h
  4. HINTS ${CLN_PKGCONF_INCLUDE_DIRS}
  5. PATHS
  6. /usr/include
  7. /usr/local/include
  8. )
  9. # Library files
  10. find_library(CLN_LIBRARY
  11. NAMES cln
  12. HINTS ${CLN_PKGCONF_LIBRARY_DIRS}
  13. PATHS
  14. /usr/lib
  15. /usr/local/lib
  16. )
  17. if(CLN_INCLUDE_DIR AND CLN_LIBRARY)
  18. set(CLN_FOUND TRUE)
  19. # Version
  20. file(STRINGS ${CLN_INCLUDE_DIR}/cln/version.h CLN_VERSION REGEX "^#define[\t ]+CL_VERSION .*")
  21. string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" CLN_VERSION "${CLN_VERSION}")
  22. if(CLN_FIND_VERSION VERSION_GREATER CLN_VERSION)
  23. message(WARNING "Required CLN ${CLN_FIND_VERSION} but found only CLN ${CLN_VERSION}.")
  24. return()
  25. endif()
  26. endif()
  27. # Cleanup
  28. mark_as_advanced(
  29. CLN_FOUND
  30. CLN_INCLUDE_DIR
  31. CLN_LIBRARY
  32. CLN_VERSION
  33. )