Commit 3a03e35c authored by zhujiashun's avatar zhujiashun

search openssl in brew installed path under macos

parent 9e227c0a
......@@ -133,22 +133,19 @@ if(NOT PROTOC_LIB)
message(FATAL_ERROR "Fail to find protoc lib")
endif()
find_path(SSL_INCLUDE_PATH NAMES openssl/ssl.h)
find_library(SSL_LIB NAMES ssl)
if ((NOT SSL_INCLUDE_PATH) OR (NOT SSL_LIB))
message(FATAL_ERROR "Fail to find ssl")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(OPENSSL_ROOT_DIR
"/usr/local/opt/openssl" # Homebrew installed OpenSSL
)
endif()
find_library(CRYPTO_LIB NAMES crypto)
if (NOT CRYPTO_LIB)
message(FATAL_ERROR "Fail to find crypto")
endif()
include(FindOpenSSL)
include_directories(
${GFLAGS_INCLUDE_PATH}
${PROTOBUF_INCLUDE_DIRS}
${LEVELDB_INCLUDE_PATH}
${SSL_INCLUDE_PATH}
${OPENSSL_INCLUDE_DIR}
)
set(DYNAMIC_LIB
......@@ -158,12 +155,13 @@ set(DYNAMIC_LIB
${PROTOC_LIB}
${CMAKE_THREAD_LIBS_INIT}
${THRIFT_LIB}
${SSL_LIB}
${CRYPTO_LIB}
${OPENSSL_LIBRARIES}
${OPENSSL_CRYPTO_LIBRARY}
dl
z
)
set(BRPC_PRIVATE_LIBS "-lgflags -lprotobuf -lleveldb -lprotoc -lrt -lssl -lcrypto -ldl -lz")
set(BRPC_PRIVATE_LIBS "-lgflags -lprotobuf -lleveldb -lprotoc -lssl -lcrypto -ldl -lz")
if(BRPC_WITH_GLOG)
set(DYNAMIC_LIB ${DYNAMIC_LIB} ${GLOG_LIB})
set(BRPC_PRIVATE_LIBS "${BRPC_PRIVATE_LIBS} -lglog")
......@@ -171,6 +169,7 @@ endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(DYNAMIC_LIB ${DYNAMIC_LIB} rt)
set(BRPC_PRIVATE_LIBS "${BRPC_PRIVATE_LIBS} -lrt")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(DYNAMIC_LIB ${DYNAMIC_LIB}
pthread
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment