FindSecurity.cmake 763 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
# Find Security.framework
# This will define :
#
# SECURITY_FOUND
# SECURITY_LIBRARIES
# SECURITY_LDFLAGS
# SECURITY_HAS_SSLCREATECONTEXT
#

FIND_PATH(SECURITY_INCLUDE_DIR NAMES Security/Security.h)
FIND_LIBRARY(SECURITY_LIBRARIES NAMES Security)
IF (SECURITY_INCLUDE_DIR AND SECURITY_LIBRARIES)
	IF (NOT Security_FIND_QUIETLY)
14
		MESSAGE(STATUS "Found Security ${SECURITY_LIBRARIES}")
15
	ENDIF()
16
	SET(SECURITY_FOUND TRUE)
17 18
	SET(SECURITY_LDFLAGS "-framework Security")
	CHECK_LIBRARY_EXISTS("${SECURITY_LIBRARIES}" SSLCreateContext "Security/SecureTransport.h" SECURITY_HAS_SSLCREATECONTEXT)
19
ENDIF ()
20 21

IF (Security_FIND_REQUIRED AND NOT SECURITY_FOUND)
22
	MESSAGE(FATAL_ERROR "Security not found")
23 24 25 26 27 28
ENDIF()

MARK_AS_ADVANCED(
	SECURITY_INCLUDE_DIR
	SECURITY_LIBRARIES
)