blob: de8e878a995963a6b1d4dfcfec2f4a69aeeaa942 [file] [log] [blame]
Brian Waters13d96012017-12-08 16:53:31 -06001# - Try to find SCTP library and headers
2# Once done, this will define
3#
4# SCTP_FOUND - system has SCTP
5# SCTP_INCLUDE_DIR - the SCTP include directories
6# SCTP_LIBRARIES - link these to use SCTP
7
8if (SCTP_INCLUDE_DIR AND SCTP_LIBRARIES)
9 set(SCTP_FIND_QUIETLY TRUE)
10endif (SCTP_INCLUDE_DIR AND SCTP_LIBRARIES)
11
12# Include dir
13find_path(SCTP_INCLUDE_DIR
14 NAMES netinet/sctp.h
15)
16
17# Library
18find_library(SCTP_LIBRARY
19 NAMES sctp
20)
21
22# Set the include dir variables and the libraries and let libfind_process do the rest.
23# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
24#set(SCTP_PROCESS_INCLUDES SCTP_INCLUDE_DIR)
25#set(SCTP_PROCESS_LIBS SCTP_LIBRARY)
26#libfind_process(SCTP)
27
28
29# handle the QUIETLY and REQUIRED arguments and set SCTP_FOUND to TRUE if
30# all listed variables are TRUE
31INCLUDE(FindPackageHandleStandardArgs)
32FIND_PACKAGE_HANDLE_STANDARD_ARGS(SCTP DEFAULT_MSG SCTP_LIBRARY SCTP_INCLUDE_DIR)
33
34# If we successfully found the sctp library then add the library to the
35# SCTP_LIBRARIES cmake variable otherwise set SCTP_LIBRARIES to nothing.
36IF(SCTP_FOUND)
37 SET( SCTP_LIBRARIES ${SCTP_LIBRARY} )
38ELSE(SCTP_FOUND)
39 SET( SCTP_LIBRARIES )
40ENDIF(SCTP_FOUND)
41
42
43# Lastly make it so that the SCTP_LIBRARY and SCTP_INCLUDE_DIR variables
44# only show up under the advanced options in the gui cmake applications.
45MARK_AS_ADVANCED( SCTP_LIBRARY SCTP_INCLUDE_DIR )
46