File: FindLibSASL2.cmake

package info (click to toggle)
wbxml2 0.11.8%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,672 kB
  • sloc: ansic: 12,690; xml: 6,399; perl: 294; sh: 159; makefile: 7; cpp: 7
file content (37 lines) | stat: -rw-r--r-- 1,379 bytes parent folder | download | duplicates (4)
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
# Try and find libsasl2.
# As soon as libsasl2 has been found, the following variables will be defined:
#
# LIBSASL2_FOUND
# SASL2_INCLUDE_DIR
# SASL2_LIBRARY:FILEPATH
#
# Copyright (c) 2009 Juergen Leising <jleising@users.sourceforge.net>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#

MESSAGE(STATUS "checking for libsasl2...")

FIND_PATH(SASL2_INCLUDE_DIR NAMES sasl/sasl.h
                             PATHS /include /usr/include /usr/local/include /usr/share/include /opt/include 
                             DOC "Try and find the header file sasl/sasl.h")

FIND_LIBRARY(SASL2_LIBRARY NAMES sasl2
                           PATHS /usr/lib /lib /usr/local/lib /usr/share/lib /opt/lib /opt/share/lib /var/lib
                           DOC "Try and find libsasl2")

IF (SASL2_INCLUDE_DIR AND SASL2_LIBRARY)
	SET (LIBSASL2_FOUND 1)
  get_filename_component(SASL2_LIBRARY_DIRS ${SASL2_LIBRARY} PATH)
  MESSAGE(STATUS "  Found ${SASL2_LIBRARY}")
ELSE (SASL2_INCLUDE_DIR AND SASL2_LIBRARY)
	IF ( LibSASL2_FIND_REQUIRED	)
	  MESSAGE( FATAL_ERROR "  Could NOT find libsasl2. The ldap plugin needs this library." )
	ELSE ( LibSASL2_FIND_REQUIRED )
		MESSAGE( STATUS "  Could NOT find libsasl2.")
	ENDIF ( LibSASL2_FIND_REQUIRED )
ENDIF (SASL2_INCLUDE_DIR AND SASL2_LIBRARY)