-
Notifications
You must be signed in to change notification settings - Fork 6
/
FindSMB.cmake
37 lines (29 loc) · 972 Bytes
/
FindSMB.cmake
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:
# FindSMB
# -------
# Finds the libsmb library
#
# This will will define the following variables::
#
# SMB_FOUND - system has libsmb
# SMB_INCLUDE_DIRS - the libsmb include directory
# SMB_LIBRARIES - the libsmb libraries
# SMB_DEFINITIONS - the libsmb compile definitions
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_SMB libsmb2 QUIET)
endif()
find_path(SMB_INCLUDE_DIR smb2/libsmb2.h
PATHS ${PC_SMB_INCLUDEDIR})
set(SMB_VERSION ${PC_SMB_VERSION})
include(FindPackageHandleStandardArgs)
find_library(SMB_LIBRARY NAMES smb2
PATHS ${PC_SMB_LIBDIR})
find_package_handle_standard_args(SMB
REQUIRED_VARS SMB_LIBRARY SMB_INCLUDE_DIR
VERSION_VAR SMB_VERSION)
if(SMB_FOUND)
set(SMB_LIBRARIES ${SMB_LIBRARY})
set(SMB_INCLUDE_DIRS ${SMB_INCLUDE_DIR})
set(SMB_DEFINITIONS -DHAVE_LIBSMB=1)
endif()
mark_as_advanced(SMB_INCLUDE_DIR SMB_LIBRARY)