]> git.proxmox.com Git - libgit2.git/blob - cmake/FindSecurity.cmake
New upstream version 1.4.3+dfsg.1
[libgit2.git] / cmake / 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(STATUS "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_ERROR "Security not found")
23 endif()
24
25 mark_as_advanced(
26 SECURITY_INCLUDE_DIR
27 SECURITY_LIBRARIES
28 )