3 if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
6 include(GNUInstallDirs)
7 include(CMakePackageConfigHelpers)
9 if(CMAKE_HOST_SYSTEM_NAME MATCHES "BSD")
10 find_program(PKGCONF pkgconf)
12 set(PKG_CONFIG_EXECUTABLE ${PKGCONF})
15 find_package(PkgConfig)
16 set(THREADS_PREFER_PTHREAD_FLAG ON)
17 find_package(Threads REQUIRED)
20 include(InstallPublicHeaders)
24 include(CheckDependency)
26 include(CheckCompiles)
28 include(TestBigEndian)
29 include(CheckByteswap)
43 message(WARNING "The dtrace command is required to enable dtrace/systemtap support.")
49 if(NOT MEMCACHED_BINARY)
50 find_package(Memcached)
51 set(MEMCACHED_BINARY ${MEMCACHED_EXECUTABLE})
57 check_dependency(LIBSASL sasl2 sasl/sasl.h)
59 set(LIBMEMCACHED_WITH_SASL_SUPPORT 1)
65 set(HAVE_FNV64_HASH 1)
67 if(ENABLE_HASH_MURMUR)
68 set(HAVE_MURMUR_HASH 1)
71 set(HAVE_HSIEH_HASH 1)
76 test_big_endian(WORDS_BIGENDIAN)
79 check_header(alloca.h)
80 check_header(arpa/inet.h)
85 check_header(limits.h)
88 check_header(stddef.h)
89 check_header(stdlib.h)
90 check_header(strings.h)
91 check_header(sys/socket.h)
92 check_header(sys/time.h)
93 check_header(sys/types.h)
94 check_header(sys/un.h)
95 check_header(sys/wait.h)
98 check_header(unistd.h)
99 check_header(winsock2.h)
100 check_header(ws2tcpip.h)
102 check_decl(fcntl fcntl.h)
103 check_decl(htonll arpa/inet.h)
104 check_decl(MSG_DONTWAIT sys/socket.h)
105 check_decl(MSG_MORE sys/socket.h)
106 check_decl(MSG_NOSIGNAL sys/socket.h)
107 check_decl(SO_RCVTIMEO sys/socket.h)
108 check_decl(SO_SNDTIMEO sys/socket.h)
109 check_decl(setenv stdlib.h)
110 check_decl(strerror string.h)
111 check_decl(strerror_r string.h)
113 check_compiles(HAVE_STRERROR_R_CHAR_P "char x, y = *strerror_r(0,&x,1);" string.h)
115 check_decl(abi::__cxa_demangle cxxabi.h)
117 find_package(Backtrace)
119 set(HAVE_BACKTRACE 1)
120 set(BACKTRACE BACKTRACE)
121 add_library(BACKTRACE INTERFACE IMPORTED)
122 set_target_properties(BACKTRACE PROPERTIES
123 INTERFACE_LINK_LIBRARIES "${Backtrace_LIBRARIES}"
124 INTERFACE_INCLUDE_DIRECTORIES "${Backtrace_INCLUDE_DIR}")
127 check_type(in_port_t netinet/in.h)
129 check_header(cstdint)
130 check_header(cinttypes)
131 check_header(inttypes.h)