Unverified Commit 2fe49c9b authored by Ge Jun's avatar Ge Jun Committed by GitHub

Merge pull request #1032 from zyearn/replace_include_with_find_package

replace_include_with_find_package
parents 6934a7d6 faea9470
......@@ -142,8 +142,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif()
endif()
include(FindProtobuf)
include(FindThreads)
find_package(Protobuf REQUIRED)
find_package(Threads REQUIRED)
find_path(LEVELDB_INCLUDE_PATH NAMES leveldb/db.h)
find_library(LEVELDB_LIB NAMES leveldb)
......@@ -182,7 +182,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
)
endif()
include(FindOpenSSL)
find_package(OpenSSL)
include_directories(
${GFLAGS_INCLUDE_PATH}
......
......@@ -102,15 +102,13 @@ if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB))
endif()
include_directories(${LEVELDB_INCLUDE_PATH})
find_library(SSL_LIB NAMES ssl)
if (NOT SSL_LIB)
message(FATAL_ERROR "Fail to find ssl")
endif()
find_library(CRYPTO_LIB NAMES crypto)
if (NOT CRYPTO_LIB)
message(FATAL_ERROR "Fail to find crypto")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(OPENSSL_ROOT_DIR
"/usr/local/opt/openssl" # Homebrew installed OpenSSL
)
endif()
include_directories(${OPENSSL_INCLUDE_DIR})
find_package(OpenSSL)
add_executable(echo_client client.cpp ${PROTO_SRC} ${PROTO_HEADER})
add_executable(echo_server server.cpp ${PROTO_SRC} ${PROTO_HEADER})
......@@ -120,8 +118,8 @@ set(DYNAMIC_LIB
${GFLAGS_LIBRARY}
${PROTOBUF_LIBRARIES}
${LEVELDB_LIB}
${SSL_LIB}
${CRYPTO_LIB}
${OPENSSL_CRYPTO_LIBRARY}
${OPENSSL_SSL_LIBRARY}
${THRIFT_LIB}
${THRIFTNB_LIB}
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