]> git.proxmox.com Git - libgit2.git/blob - cmake/Modules/FindSecurity.cmake
487f7e500b50f1f461655d17128a68764a16fd6b
[libgit2.git] / cmake / Modules / FindSecurity.cmake
1 # Find Security.framework
2 # This will define :
3 #
4 # SECURITY_FOUND
5 # SECURITY_LIBRARIES
6 # SECURITY_LDFLAGS
7 # SECURITY_HAS_SSLCREATECONTEXT
8 #
9
10 FIND_PATH(SECURITY_INCLUDE_DIR NAMES Security/Security.h)
11 FIND_LIBRARY(SECURITY_LIBRARIES NAMES Security)
12 IF (SECURITY_INCLUDE_DIR AND SECURITY_LIBRARIES)
13 IF (NOT Security_FIND_QUIETLY)
14 MESSAGE("-- Found Security ${SECURITY_LIBRARIES}")
15 ENDIF()
16 SET(SECURITY_FOUND TRUE)
17 SET(SECURITY_LDFLAGS "-framework Security")
18 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 "-- Security not found")
23 ENDIF()
24
25 MARK_AS_ADVANCED(
26 SECURITY_INCLUDE_DIR
27 SECURITY_LIBRARIES
28 )