diff options
author | Brad King <brad.king@kitware.com> | 2014-12-15 19:36:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-12-18 14:44:19 (GMT) |
commit | e4563257ba66266017fadf24c1b97fd103a138e4 (patch) | |
tree | af47eb4bf49ce109ff7aee539f66611132fbd0d7 /Utilities/cmcurl/CMakeLists.txt | |
parent | ba8c6632194256a6a3370713d8e0423ad516361a (diff) | |
download | CMake-e4563257ba66266017fadf24c1b97fd103a138e4.zip CMake-e4563257ba66266017fadf24c1b97fd103a138e4.tar.gz CMake-e4563257ba66266017fadf24c1b97fd103a138e4.tar.bz2 |
curl: Use OS X SSL/TLS native implementation
On OS X, when CMAKE_USE_OPENSSL is OFF, use the OS implementation.
This will allow the OS-configured CA list to be trusted automatically.
This is supported on OS X 10.6 and above using AppleClang, Clang, and
GNU compilers.
Diffstat (limited to 'Utilities/cmcurl/CMakeLists.txt')
-rw-r--r-- | Utilities/cmcurl/CMakeLists.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index 1092e48..0db741e 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -464,6 +464,25 @@ elseif(WIN32) # Use Windows SSL/TLS native implementation. add_definitions(-DUSE_SCHANNEL) set(USE_WINDOWS_SSPI 1) +elseif(APPLE) + # Use OS X SSL/TLS native implementation if available on target version. + if(CMAKE_OSX_DEPLOYMENT_TARGET) + set(OSX_VERSION ${CMAKE_OSX_DEPLOYMENT_TARGET}) + else() + execute_process( + COMMAND sw_vers -productVersion + OUTPUT_VARIABLE OSX_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + endif() + if(NOT OSX_VERSION VERSION_LESS 10.6 AND + CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|AppleClang") + add_definitions(-DUSE_DARWINSSL) + list(APPEND CURL_LIBS + "-framework CoreFoundation" + "-framework Security" + ) + endif() endif() #libSSH2 |