docs: cmake build
[awesomized/libmemcached] / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.9..3.16)
2
3 if(${CMAKE_VERSION} VERSION_LESS 3.12)
4 cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
5 endif()
6
7 project(libmemcached
8 VERSION 1.99
9 DESCRIPTION "libmemcached https://github.com/m6w6/libmemcached"
10 )
11
12 set(CMAKE_CXX_STANDARD 11)
13 set(CMAKE_CXX_STANDARD_REQUIRED ON)
14 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
15
16 include(Config.cmake)
17 include(Include.cmake)
18
19 find_package(Threads REQUIRED)
20 find_library(HAVE_LIBSASL NAMES sasl sasl2)
21 check_header(sasl/sasl.h)
22
23 check_header(arpa/inet.h)
24 check_header(dlfcn.h)
25 check_header(errno.h)
26 check_header(execinfo.h)
27 check_header(fcntl.h)
28 check_header(io.h)
29 check_header(limits.h)
30 check_header(netdb.h)
31 check_header(poll.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)
39 check_header(time.h)
40 check_header(umem.h)
41 check_header(unistd.h)
42 check_header(winsock2.h)
43 check_header(ws2tcpip.h)
44
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})
56
57 check_type(in_port_t netinet/in.h)
58
59 check_header(cstdint)
60 check_header(cinttypes)
61
62 check_debug()
63
64 include_directories(${CMAKE_BINARY_DIR})
65
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)
72
73 add_subdirectory(docs)
74
75 # keep last
76 configure_file(mem_config.h.in ${CMAKE_BINARY_DIR}/mem_config.h @ONLY)