WiP cmake-ify
[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 configure_file(mem_config.h.in ${CMAKE_BINARY_DIR}/mem_config.h @ONLY)
65
66 include_directories(${CMAKE_BINARY_DIR})
67
68 add_subdirectory(clients)
69 add_subdirectory(libhashkit)
70 add_subdirectory(libhashkit-1.0)
71 add_subdirectory(libmemcached)
72 add_subdirectory(libmemcached-1.0)
73 add_subdirectory(libmemcachedinternal)
74 add_subdirectory(libmemcachedutil)
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93 include_directories(${CMAKE_BINARY_DIR})
94 include_directories(.)
95 include_directories(clients)
96 include_directories(example)
97 include_directories(libhashkit)
98 include_directories(libhashkit-1.0)
99 include_directories(libmemcached)
100 include_directories(libmemcached/csl)
101 include_directories(libmemcached/memcached)
102 include_directories(libmemcached-1.0)
103 include_directories(libmemcached-1.0/struct)
104 include_directories(libmemcached-1.0/types)
105 include_directories(libmemcachedprotocol)
106 include_directories(libmemcachedprotocol-0.0)
107 include_directories(libmemcachedutil)
108 include_directories(libmemcachedutil-1.0)
109 include_directories(libtest)
110 include_directories(libtest/exception)
111 include_directories(libtest/result)
112 include_directories(tests)
113 include_directories(tests/libmemcached-1.0)
114 include_directories(util)
115 include_directories(win32)
116
117
118 if (FALSE)
119 add_executable(nope
120 example/byteorder.cc
121 example/byteorder.h
122 example/interface_v0.cc
123 example/interface_v1.cc
124 example/memcached_light.cc
125 example/memcached_light.h
126 example/storage.cc
127 example/storage.h
128
129
130 libmemcached-1.0/t/c_sasl_test.c
131 libmemcached-1.0/t/c_test.c
132 libmemcached-1.0/t/cc_test.cc
133
134 libmemcachedprotocol/ascii_handler.c
135 libmemcachedprotocol/ascii_handler.h
136 libmemcachedprotocol/binary_handler.c
137 libmemcachedprotocol/binary_handler.h
138 libmemcachedprotocol/cache.c
139 libmemcachedprotocol/cache.h
140 libmemcachedprotocol/common.h
141 libmemcachedprotocol/handler.c
142 libmemcachedprotocol/pedantic.c
143 libmemcachedprotocol-0.0/binary.h
144 libmemcachedprotocol-0.0/callback.h
145 libmemcachedprotocol-0.0/handler.h
146 libmemcachedprotocol-0.0/vbucket.h
147
148 libmemcachedutil/common.h
149
150 libmemcachedutil-1.0/flush.h
151 libmemcachedutil-1.0/ostream.hpp
152 libmemcachedutil-1.0/pid.h
153 libmemcachedutil-1.0/ping.h
154 libmemcachedutil-1.0/pool.h
155 libmemcachedutil-1.0/util.h
156 libmemcachedutil-1.0/version.h
157
158 libtest/exception/disconnected.hpp
159 libtest/exception/fatal.cc
160 libtest/exception/fatal.hpp
161 libtest/result/base.hpp
162 libtest/result/fail.hpp
163 libtest/result/skip.hpp
164 libtest/result/success.hpp
165 libtest/abort.cc
166 libtest/alarm.cc
167 libtest/alarm.h
168 libtest/backtrace_test.cc
169 libtest/binaries.cc
170 libtest/binaries.h
171 libtest/blobslap_worker.cc
172 libtest/blobslap_worker.h
173 libtest/callbacks.h
174 libtest/client.cc
175 libtest/client.hpp
176 libtest/cmdline.cc
177 libtest/cmdline.h
178 libtest/collection.cc
179 libtest/collection.h
180 libtest/common.h
181 libtest/comparison.cc
182 libtest/comparison.hpp
183 libtest/core.cc
184 libtest/core.h
185 libtest/core_count.cc
186 libtest/cpu.cc
187 libtest/cpu.hpp
188 libtest/dns.cc
189 libtest/dns.hpp
190 libtest/dream.cc
191 libtest/dream.h
192 libtest/drizzled.cc
193 libtest/drizzled.h
194 libtest/error.h
195 libtest/exception.cc
196 libtest/exception.hpp
197 libtest/failed.cc
198 libtest/formatter.cc
199 libtest/formatter.hpp
200 libtest/framework.cc
201 libtest/framework.h
202 libtest/gearmand.cc
203 libtest/gearmand.h
204 libtest/get.h
205 libtest/has.cc
206 libtest/has.hpp
207 libtest/http.cc
208 libtest/http.hpp
209 libtest/is_local.cc
210 libtest/is_local.hpp
211 libtest/is_pid.hpp
212 libtest/killpid.cc
213 libtest/killpid.h
214 libtest/libtool.cc
215 libtest/libtool.hpp
216 libtest/lite.h
217 libtest/main.cc
218 libtest/memcached.cc
219 libtest/memcached.h
220 libtest/memcached.hpp
221 libtest/poll_error.hpp
222 libtest/port.cc
223 libtest/port.h
224 libtest/result.cc
225 libtest/result.hpp
226 libtest/runner.cc
227 libtest/runner.h
228 libtest/server.cc
229 libtest/server.h
230 libtest/server_container.cc
231 libtest/server_container.h
232 libtest/signal.cc
233 libtest/signal.h
234 libtest/skiptest.cc
235 libtest/socket.cc
236 libtest/socket.hpp
237 libtest/stream.h
238 libtest/strerror.cc
239 libtest/strerror.h
240 libtest/string.hpp
241 libtest/test.h
242 libtest/test.hpp
243 libtest/thread.hpp
244 libtest/timer.cc
245 libtest/timer.hpp
246 libtest/tmpfile.cc
247 libtest/tmpfile.hpp
248 libtest/unittest.cc
249 libtest/valgrind.h
250 libtest/vchar.cc
251 libtest/vchar.hpp
252 libtest/version.h
253 libtest/visibility.h
254 libtest/wait.cc
255 libtest/wait.h
256 libtest/yatl.h
257 libtest/yatlcon.h
258
259 tests/libmemcached-1.0/all_tests.cc
260 tests/libmemcached-1.0/all_tests.h
261 tests/libmemcached-1.0/all_tests_socket.cc
262 tests/libmemcached-1.0/atomsmasher.cc
263 tests/libmemcached-1.0/basic.cc
264 tests/libmemcached-1.0/callback_counter.cc
265 tests/libmemcached-1.0/callback_counter.h
266 tests/libmemcached-1.0/callbacks.cc
267 tests/libmemcached-1.0/debug.cc
268 tests/libmemcached-1.0/deprecated.cc
269 tests/libmemcached-1.0/dump.cc
270 tests/libmemcached-1.0/dump.h
271 tests/libmemcached-1.0/encoding_key.cc
272 tests/libmemcached-1.0/encoding_key.h
273 tests/libmemcached-1.0/error_conditions.cc
274 tests/libmemcached-1.0/exist.cc
275 tests/libmemcached-1.0/fetch_all_results.cc
276 tests/libmemcached-1.0/fetch_all_results.h
277 tests/libmemcached-1.0/generate.cc
278 tests/libmemcached-1.0/generate.h
279 tests/libmemcached-1.0/haldenbrand.cc
280 tests/libmemcached-1.0/haldenbrand.h
281 tests/libmemcached-1.0/internals.cc
282 tests/libmemcached-1.0/ketama.cc
283 tests/libmemcached-1.0/mem_functions.cc
284 tests/libmemcached-1.0/mem_functions.h
285 tests/libmemcached-1.0/memcached_fetch_execute.cc
286 tests/libmemcached-1.0/memcached_fetch_execute.h
287 tests/libmemcached-1.0/memcached_get.cc
288 tests/libmemcached-1.0/memcached_get.h
289 tests/libmemcached-1.0/namespace.cc
290 tests/libmemcached-1.0/parser.cc
291 tests/libmemcached-1.0/parser.h
292 tests/libmemcached-1.0/plus.cpp
293 tests/libmemcached-1.0/pool.cc
294 tests/libmemcached-1.0/print.cc
295 tests/libmemcached-1.0/replication.cc
296 tests/libmemcached-1.0/sasl.cc
297 tests/libmemcached-1.0/server_add.cc
298 tests/libmemcached-1.0/setup_and_teardowns.cc
299 tests/libmemcached-1.0/setup_and_teardowns.h
300 tests/libmemcached-1.0/stat.cc
301 tests/libmemcached-1.0/stat.h
302 tests/libmemcached-1.0/string.cc
303 tests/libmemcached-1.0/touch.cc
304 tests/libmemcached-1.0/virtual_buckets.cc
305 tests/basic.h
306 tests/callbacks.h
307 tests/cpp_example.cc
308 tests/cycle.cc
309 tests/debug.h
310 tests/deprecated.h
311 tests/error_conditions.h
312 tests/exist.h
313 tests/failure.cc
314 tests/hash_plus.cc
315 tests/hash_results.h
316 tests/hashkit_functions.cc
317 tests/ketama.h
318 tests/ketama_test_cases.h
319 tests/ketama_test_cases_spy.h
320 tests/keys.hpp
321 tests/libmemcached_test_container.h
322 tests/libmemcached_world.h
323 tests/libmemcached_world_socket.h
324 tests/mem_udp.cc
325 tests/memc.hpp
326 tests/memcapable.cc
327 tests/memcat.cc
328 tests/memcp.cc
329 tests/memdump.cc
330 tests/memerror.cc
331 tests/memexist.cc
332 tests/memflush.cc
333 tests/memping.cc
334 tests/memrm.cc
335 tests/memslap.cc
336 tests/memstat.cc
337 tests/memtouch.cc
338 tests/namespace.h
339 tests/parser.cc
340 tests/pool.h
341 tests/print.h
342 tests/replication.h
343 tests/runner.h
344 tests/server_add.h
345 tests/string.h
346 tests/touch.h
347 tests/virtual_buckets.h
348
349 util/daemon.cc
350 util/daemon.hpp
351 util/instance.cc
352 util/instance.hpp
353 util/log.hpp
354 util/logfile.cc
355 util/logfile.hpp
356 util/operation.cc
357 util/operation.hpp
358 util/pidfile.cc
359 util/pidfile.hpp
360 util/signal.cc
361 util/signal.hpp
362 util/string.hpp
363
364 win32/wrappers.h
365
366 )
367 endif()