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) ...@@ -133,22 +133,19 @@ if(NOT PROTOC_LIB)
message(FATAL_ERROR "Fail to find protoc lib") message(FATAL_ERROR "Fail to find protoc lib")
endif() endif()
find_path(SSL_INCLUDE_PATH NAMES openssl/ssl.h) if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
find_library(SSL_LIB NAMES ssl) set(OPENSSL_ROOT_DIR
if ((NOT SSL_INCLUDE_PATH) OR (NOT SSL_LIB)) "/usr/local/opt/openssl" # Homebrew installed OpenSSL
message(FATAL_ERROR "Fail to find ssl") )
endif() endif()
find_library(CRYPTO_LIB NAMES crypto) include(FindOpenSSL)
if (NOT CRYPTO_LIB)
message(FATAL_ERROR "Fail to find crypto")
endif()
include_directories( include_directories(
${GFLAGS_INCLUDE_PATH} ${GFLAGS_INCLUDE_PATH}
${PROTOBUF_INCLUDE_DIRS} ${PROTOBUF_INCLUDE_DIRS}
${LEVELDB_INCLUDE_PATH} ${LEVELDB_INCLUDE_PATH}
${SSL_INCLUDE_PATH} ${OPENSSL_INCLUDE_DIR}
) )
set(DYNAMIC_LIB set(DYNAMIC_LIB
...@@ -158,12 +155,13 @@ set(DYNAMIC_LIB ...@@ -158,12 +155,13 @@ set(DYNAMIC_LIB
${PROTOC_LIB} ${PROTOC_LIB}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${THRIFT_LIB} ${THRIFT_LIB}
${SSL_LIB} ${OPENSSL_LIBRARIES}
${CRYPTO_LIB} ${OPENSSL_CRYPTO_LIBRARY}
dl dl
z 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) if(BRPC_WITH_GLOG)
set(DYNAMIC_LIB ${DYNAMIC_LIB} ${GLOG_LIB}) set(DYNAMIC_LIB ${DYNAMIC_LIB} ${GLOG_LIB})
set(BRPC_PRIVATE_LIBS "${BRPC_PRIVATE_LIBS} -lglog") set(BRPC_PRIVATE_LIBS "${BRPC_PRIVATE_LIBS} -lglog")
...@@ -171,6 +169,7 @@ endif() ...@@ -171,6 +169,7 @@ endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(DYNAMIC_LIB ${DYNAMIC_LIB} rt) set(DYNAMIC_LIB ${DYNAMIC_LIB} rt)
set(BRPC_PRIVATE_LIBS "${BRPC_PRIVATE_LIBS} -lrt")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(DYNAMIC_LIB ${DYNAMIC_LIB} set(DYNAMIC_LIB ${DYNAMIC_LIB}
pthread 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