summaryrefslogtreecommitdiffstats
path: root/cmake/modules/Findlibnbd.cmake
blob: 4a908659a6bdad4eaa9f8939e57eb37a5a6e5402 (plain)
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
31
32
33
# - Find libnbd
# Sets the following:
#
# LIBNBD_INCLUDE_DIR
# LIBNBD_LIBRARIES
# LIBNBD_VERSION
# LIBNBD_FOUND

find_package(PkgConfig QUIET REQUIRED)
pkg_search_module(PC_libnbd libnbd)

find_path(LIBNBD_INCLUDE_DIR
        NAMES libnbd.h
        PATHS ${PC_libnbd_INCLUDE_DIRS})

find_library(LIBNBD_LIBRARIES
        NAMES libnbd.so
        PATHS ${PC_libnbd_LIBRARY_DIRS})

set(LIBNBD_VERSION ${PC_libnbd_VERSION})

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args(libnbd
        REQUIRED_VARS
        LIBNBD_INCLUDE_DIR
        LIBNBD_LIBRARIES
        VERSION_VAR LIBNBD_VERSION)

mark_as_advanced(
  LIBNBD_LIBRARIES
  LIBNBD_INCLUDE_DIR
  LIBNBD_VERSION)