Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use find_package with SnappyConfig.cmake instead of find_path #1812

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,7 @@ if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB))
endif()

if(WITH_SNAPPY)
find_path(SNAPPY_INCLUDE_PATH NAMES snappy.h)
find_library(SNAPPY_LIB NAMES snappy)
if ((NOT SNAPPY_INCLUDE_PATH) OR (NOT SNAPPY_LIB))
message(FATAL_ERROR "Fail to find snappy")
endif()
include_directories(${SNAPPY_INCLUDE_PATH})
find_package(Snappy REQUIRED)
endif()

if(WITH_GLOG)
Expand Down Expand Up @@ -228,7 +223,7 @@ if(WITH_GLOG)
endif()

if(WITH_SNAPPY)
set(DYNAMIC_LIB ${DYNAMIC_LIB} ${SNAPPY_LIB})
set(DYNAMIC_LIB ${DYNAMIC_LIB} Snappy::snappy)
set(BRPC_PRIVATE_LIBS "${BRPC_PRIVATE_LIBS} -lsnappy")
endif()

Expand Down