Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
99d6ebb3
Commit
99d6ebb3
authored
Sep 06, 2017
by
Etienne Samson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: make our macOS helpers more CMake-y
parent
152f3766
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
28 deletions
+58
-28
cmake/Modules/FindCoreFoundation.cmake
+24
-7
cmake/Modules/FindSecurity.cmake
+26
-7
src/CMakeLists.txt
+8
-14
No files found.
cmake/Modules/FindCoreFoundation.cmake
View file @
99d6ebb3
IF
(
COREFOUNDATION_INCLUDE_DIR AND COREFOUNDATION_DIRS
)
# Find CoreFoundation.framework
# This will define :
#
# COREFOUNDATION_FOUND
# COREFOUNDATION_LIBRARIES
# COREFOUNDATION_LDFLAGS
#
FIND_PATH
(
COREFOUNDATION_INCLUDE_DIR NAMES CoreFoundation.h
)
FIND_LIBRARY
(
COREFOUNDATION_LIBRARIES NAMES CoreFoundation
)
IF
(
COREFOUNDATION_INCLUDE_DIR AND COREFOUNDATION_LIBRARIES
)
IF
(
NOT CoreFoundation_FIND_QUIETLY
)
MESSAGE
(
"-- Found CoreFoundation
${
COREFOUNDATION_LIBRARIES
}
"
)
ENDIF
()
SET
(
COREFOUNDATION_FOUND TRUE
)
ELSE
()
FIND_PATH
(
COREFOUNDATION_INCLUDE_DIR NAMES CoreFoundation.h
)
FIND_LIBRARY
(
COREFOUNDATION_DIRS NAMES CoreFoundation
)
IF
(
COREFOUNDATION_INCLUDE_DIR AND COREFOUNDATION_DIRS
)
SET
(
COREFOUNDATION_FOUND TRUE
)
ENDIF
()
SET
(
COREFOUNDATION_LDFLAGS
"-framework CoreFoundation"
)
ENDIF
()
IF
(
CoreFoundation_FIND_REQUIRED AND NOT COREFOUNDATION_FOUND
)
MESSAGE
(
FATAL
"-- CoreFoundation not found"
)
ENDIF
()
MARK_AS_ADVANCED
(
COREFOUNDATION_INCLUDE_DIR
COREFOUNDATION_LIBRARIES
)
cmake/Modules/FindSecurity.cmake
View file @
99d6ebb3
IF
(
SECURITY_INCLUDE_DIR AND SECURITY_DIRS
)
# 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
)
MESSAGE
(
"-- Found Security
${
SECURITY_LIBRARIES
}
"
)
ENDIF
()
SET
(
SECURITY_FOUND TRUE
)
ELSE
()
FIND_PATH
(
SECURITY_INCLUDE_DIR NAMES Security/Security.h
)
FIND_LIBRARY
(
SECURITY_DIRS NAMES Security
)
IF
(
SECURITY_INCLUDE_DIR AND SECURITY_DIRS
)
SET
(
SECURITY_FOUND TRUE
)
ENDIF
()
SET
(
SECURITY_LDFLAGS
"-framework Security"
)
CHECK_LIBRARY_EXISTS
(
"
${
SECURITY_LIBRARIES
}
"
SSLCreateContext
"Security/SecureTransport.h"
SECURITY_HAS_SSLCREATECONTEXT
)
ENDIF
()
IF
(
Security_FIND_REQUIRED AND NOT SECURITY_FOUND
)
MESSAGE
(
FATAL
"-- Security not found"
)
ENDIF
()
MARK_AS_ADVANCED
(
SECURITY_INCLUDE_DIR
SECURITY_LIBRARIES
)
src/CMakeLists.txt
View file @
99d6ebb3
...
...
@@ -95,23 +95,17 @@ IF(THREADSAFE)
ENDIF
()
IF
(
SECURITY_FOUND
)
# OS X 10.7 and older do not have some functions we use, fall back to OpenSSL there
CHECK_LIBRARY_EXISTS
(
"
${
SECURITY_DIRS
}
"
SSLCreateContext
"Security/SecureTransport.h"
HAVE_NEWER_SECURITY
)
IF
(
HAVE_NEWER_SECURITY
)
MESSAGE
(
"-- Found Security
${
SECURITY_DIRS
}
"
)
LIST
(
APPEND LIBGIT2_PC_LIBS
"-framework Security"
)
LIST
(
APPEND LIBGIT2_LIBS
${
SECURITY_DIRS
}
)
ELSE
()
MESSAGE
(
"-- Security framework is too old, falling back to OpenSSL"
)
SET
(
SECURITY_FOUND
"NO"
)
SET
(
USE_OPENSSL
"ON"
)
ENDIF
()
IF
(
SECURITY_HAS_SSLCREATECONTEXT
)
LIST
(
APPEND LIBGIT2_PC_LIBS
${
SECURITY_LDFLAGS
}
)
ELSE
()
MESSAGE
(
"-- Security framework is too old, falling back to OpenSSL"
)
SET
(
USE_OPENSSL
"ON"
)
ENDIF
()
ENDIF
()
IF
(
COREFOUNDATION_FOUND
)
MESSAGE
(
"-- Found CoreFoundation
${
COREFOUNDATION_DIRS
}
"
)
LIST
(
APPEND LIBGIT2_PC_LIBS
"-framework CoreFoundation"
)
LIST
(
APPEND LIBGIT2_LIBS
${
COREFOUNDATION_DIRS
}
)
LIST
(
APPEND LIBGIT2_LIBS
${
COREFOUNDATION_LIBRARIES
}
)
LIST
(
APPEND LIBGIT2_PC_LIBS
${
COREFOUNDATION_LDFLAGS
}
)
ENDIF
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment