File: FindCLN.cmake

package info (click to toggle)
cvc4 1.8-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 69,876 kB
  • sloc: cpp: 274,686; sh: 5,833; python: 1,893; java: 929; lisp: 763; ansic: 275; perl: 214; makefile: 22; awk: 2
file content (30 lines) | stat: -rw-r--r-- 1,024 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Find CLN
# CLN_FOUND - system has CLN lib
# CLN_INCLUDE_DIR - the CLN include directory
# CLN_LIBRARIES - Libraries needed to use CLN

find_path(CLN_INCLUDE_DIR NAMES cln/cln.h)
find_library(CLN_LIBRARIES NAMES cln)


if(CLN_INCLUDE_DIR)
  file(STRINGS
        "${CLN_INCLUDE_DIR}/cln/version.h" version_info
        REGEX "^#define[ \t]+CL_VERSION_.*")
  string(REGEX REPLACE
         "^.*_MAJOR[ \t]+([0-9]+).*" "\\1" version_major "${version_info}")
  string(REGEX REPLACE
         "^.*_MINOR[ \t]+([0-9]+).*" "\\1" version_minor "${version_info}")
  string(REGEX REPLACE
         "^.*_PATCHLEVEL[ \t]+([0-9]+).*" "\\1" version_patch "${version_info}")
  set(CLN_VERSION ${version_major}.${version_minor}.${version_patch})

  include(FindPackageHandleStandardArgs)
  find_package_handle_standard_args(CLN
    REQUIRED_VARS CLN_INCLUDE_DIR CLN_LIBRARIES
    VERSION_VAR CLN_VERSION)
  mark_as_advanced(CLN_INCLUDE_DIR CLN_LIBRARIES)
endif()
if(CLN_LIBRARIES)
  message(STATUS "Found CLN libs: ${CLN_LIBRARIES}")
endif()