File: FindSMB2.cmake

package info (click to toggle)
libsmb2 6.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,424 kB
  • sloc: ansic: 32,679; sh: 221; makefile: 189; cpp: 98
file content (37 lines) | stat: -rw-r--r-- 1,004 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
31
32
33
34
35
36
37
#.rst:
# FindSMB2
# -------
# Finds the libsmb2 library
#
# This will will define the following variables::
#
# SMB2_FOUND - system has libsmb2
# SMB2_INCLUDE_DIRS - the libsmb2 include directory
# SMB2_LIBRARIES - the libsmb2 libraries
# SMB2_DEFINITIONS - the libsmb2 compile definitions

if(PKG_CONFIG_FOUND)
  pkg_check_modules(PC_SMB2 libsmb2 QUIET)
endif()

find_path(SMB2_INCLUDE_DIR smb2/libsmb2.h
                           PATHS ${PC_SMB2_INCLUDEDIR})

set(SMB2_VERSION ${PC_SMB2_VERSION})

include(FindPackageHandleStandardArgs)

find_library(SMB2_LIBRARY NAMES smb2
                          PATHS ${PC_SMB2_LIBDIR})

find_package_handle_standard_args(SMB2
                                  REQUIRED_VARS SMB2_LIBRARY SMB2_INCLUDE_DIR
                                  VERSION_VAR SMB2_VERSION)

if(SMB2_FOUND)
  set(SMB2_LIBRARIES ${SMB2_LIBRARY})
  set(SMB2_INCLUDE_DIRS ${SMB2_INCLUDE_DIR})
  set(SMB2_DEFINITIONS -DHAVE_LIBSMB2=1)
endif()

mark_as_advanced(SMB2_INCLUDE_DIR SMB2_LIBRARY)