Skip to content

Commit 6a7e92c

Browse files
authored
Merge pull request #691 from anonimal/fix-690
OSX: fix OpenSSL detection for 10.11. Fixes #690
2 parents eedd031 + acb020b commit 6a7e92c

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

CMakeLists.txt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,23 @@ set(Boost_USE_MULTI_THREADED ON)
4949
find_package(Boost 1.58.0 REQUIRED COMPONENTS system thread)
5050

5151
if (CPP-NETLIB_ENABLE_HTTPS)
52-
find_package( OpenSSL )
52+
if (APPLE)
53+
# If we're on OS X check for Homebrew's copy of OpenSSL instead of Apple's
54+
if (NOT OpenSSL_DIR)
55+
find_program(HOMEBREW brew)
56+
if (HOMEBREW STREQUAL "HOMEBREW-NOTFOUND")
57+
message(WARNING "Homebrew not found: not using Homebrew's OpenSSL")
58+
if (NOT OPENSSL_ROOT_DIR)
59+
message(WARNING "Use -DOPENSSL_ROOT_DIR for non-Apple OpenSSL")
60+
endif()
61+
else()
62+
execute_process(COMMAND brew --prefix openssl
63+
OUTPUT_VARIABLE OPENSSL_ROOT_DIR
64+
OUTPUT_STRIP_TRAILING_WHITESPACE)
65+
endif()
66+
endif()
67+
endif()
68+
find_package(OpenSSL)
5369
endif()
5470

5571
find_package( Threads )

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy