Find zookeeper and boost properly using cmake

This commit is contained in:
Matias Fontanini
2016-06-13 20:53:54 -07:00
parent 0f5660710a
commit 5dcf01c1fc
3 changed files with 49 additions and 7 deletions

33
cmake/FindZookeeper.cmake Normal file
View File

@@ -0,0 +1,33 @@
find_path(ZOOKEEPER_ROOT_DIR
NAMES include/zookeeper/zookeeper.h
)
find_path(ZOOKEEPER_INCLUDE_DIR
NAMES zookeeper/zookeeper.h
HINTS ${ZOOOKEEPER_ROOT_DIR}/include
)
set (HINT_DIR ${ZOOKEEPER_ROOT_DIR}/lib)
find_library(ZOOKEEPER_LIBRARY
NAMES zookeeper_mt zookeeper_st
HINTS ${HINT_DIR}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZOOKEEPER DEFAULT_MSG
ZOOKEEPER_LIBRARY
ZOOKEEPER_INCLUDE_DIR
)
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_LIBRARIES ${ZOOKEEPER_LIBRARY})
check_cxx_source_compiles("int main() { return 0; }" ZOOKEEPER_LINKS)
set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(
ZOOKEEPER_ROOT_DIR
ZOOKEEPER_INCLUDE_DIR
ZOOKEEPER_LIBRARY
)