Commit faea9470 authored by zhujiashun's avatar zhujiashun

replace_include_with_find_package: fix example under mac

parent bcb87a65
...@@ -102,15 +102,13 @@ if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB)) ...@@ -102,15 +102,13 @@ if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB))
endif() endif()
include_directories(${LEVELDB_INCLUDE_PATH}) include_directories(${LEVELDB_INCLUDE_PATH})
find_library(SSL_LIB NAMES ssl) if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if (NOT SSL_LIB) set(OPENSSL_ROOT_DIR
message(FATAL_ERROR "Fail to find ssl") "/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() endif()
include_directories(${OPENSSL_INCLUDE_DIR})
find_package(OpenSSL)
add_executable(echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
add_executable(echo_server server.cpp ${PROTO_SRC} ${PROTO_HEADER}) add_executable(echo_server server.cpp ${PROTO_SRC} ${PROTO_HEADER})
...@@ -120,8 +118,8 @@ set(DYNAMIC_LIB ...@@ -120,8 +118,8 @@ set(DYNAMIC_LIB
${GFLAGS_LIBRARY} ${GFLAGS_LIBRARY}
${PROTOBUF_LIBRARIES} ${PROTOBUF_LIBRARIES}
${LEVELDB_LIB} ${LEVELDB_LIB}
${SSL_LIB} ${OPENSSL_CRYPTO_LIBRARY}
${CRYPTO_LIB} ${OPENSSL_SSL_LIBRARY}
${THRIFT_LIB} ${THRIFT_LIB}
${THRIFTNB_LIB} ${THRIFTNB_LIB}
dl dl
......
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