1 cmake_minimum_required(VERSION 3.9..3.16)
3 if(${CMAKE_VERSION} VERSION_LESS 3.12)
4 cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
9 DESCRIPTION "libmemcached https://github.com/m6w6/libmemcached"
12 set(CMAKE_CXX_STANDARD 11)
13 set(CMAKE_CXX_STANDARD_REQUIRED ON)
14 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
17 include(Include.cmake)
19 find_package(Threads REQUIRED)
20 find_library(HAVE_LIBSASL NAMES sasl sasl2)
21 check_header(sasl/sasl.h)
23 check_header(arpa/inet.h)
26 check_header(execinfo.h)
29 check_header(limits.h)
32 check_header(stddef.h)
33 check_header(stdlib.h)
34 check_header(strings.h)
35 check_header(sys/socket.h)
36 check_header(sys/time.h)
37 check_header(sys/types.h)
38 check_header(sys/un.h)
41 check_header(unistd.h)
42 check_header(winsock2.h)
43 check_header(ws2tcpip.h)
45 check_decl(fcntl fcntl.h)
46 check_decl(htonll arpa/inet.h)
47 check_decl(MSG_DONTWAIT sys/socket.h)
48 check_decl(MSG_MORE sys/socket.h)
49 check_decl(MSG_NOSIGNAL sys/socket.h)
50 check_decl(rcvtimeo sys/socket.h)
51 check_decl(sndtimeo sys/socket.h)
52 check_decl(strerror_r string.h)
53 check_decl(strerror string.h)
54 check_decl(abi::__cxa_demangle cxxabi.h)
55 set(HAVE_GCC_ABI_DEMANGLE ${HAVE_ABI____CXA_DEMANGLE})
57 check_type(in_port_t netinet/in.h)
60 check_header(cinttypes)
64 include_directories(${CMAKE_BINARY_DIR})
66 add_subdirectory(clients)
67 add_subdirectory(libhashkit)
68 add_subdirectory(libhashkit-1.0)
69 add_subdirectory(libmemcached)
70 add_subdirectory(libmemcached-1.0)
71 add_subdirectory(libmemcachedutil)
73 add_subdirectory(docs)
76 configure_file(mem_config.h.in ${CMAKE_BINARY_DIR}/mem_config.h @ONLY)