MB-19635: Initialise failovers correctly from 2.5.x vbstate
[ep-engine.git] / CMakeLists.txt
1 PROJECT(EventuallyPersistentEngine)
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
3
4 IF (${CMAKE_MAJOR_VERSION} GREATER 2)
5     CMAKE_POLICY(SET CMP0042 NEW)
6 ENDIF (${CMAKE_MAJOR_VERSION} GREATER 2)
7
8 INCLUDE(CheckFunctionExists)
9 INCLUDE(CheckIncludeFileCXX)
10 INCLUDE(CheckIncludeFiles)
11 INCLUDE(CheckLibraryExists)
12 INCLUDE(CheckSymbolExists)
13 INCLUDE(CheckTypeSize)
14
15 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_INSTALL_PREFIX}/include
16                            ${CMAKE_CURRENT_SOURCE_DIR}/include
17                            ${CMAKE_CURRENT_SOURCE_DIR}
18                            ${CMAKE_CURRENT_SOURCE_DIR}/src
19                            ${CMAKE_CURRENT_BINARY_DIR}/src
20                            ${SNAPPY_INCLUDE_DIR}
21                            ${Platform_SOURCE_DIR}/include
22                            ${Memcached_SOURCE_DIR}
23                            ${Memcached_SOURCE_DIR}/include
24                            ${Couchstore_SOURCE_DIR}/include
25                            ${CMAKE_CURRENT_BINARY_DIR})
26
27 CHECK_INCLUDE_FILES("arpa/inet.h" HAVE_ARPA_INET_H)
28 CHECK_INCLUDE_FILES("unistd.h" HAVE_UNISTD_H)
29 CHECK_INCLUDE_FILES("netdb.h" HAVE_NETDB_H)
30 CHECK_INCLUDE_FILES("mach/mach_time.h" HAVE_MACH_MACH_TIME_H)
31 CHECK_INCLUDE_FILES("poll.h" HAVE_POLL_H)
32 CHECK_INCLUDE_FILES("sysexits.h" HAVE_SYSEXITS_H)
33 CHECK_INCLUDE_FILES("unistd.h" HAVE_UNISTD_H)
34 CHECK_INCLUDE_FILES("sched.h" HAVE_SCHED_H)
35 CHECK_INCLUDE_FILES("sys/socket.h" HAVE_SYS_SOCKET_H)
36 CHECK_INCLUDE_FILES("sys/time.h" HAVE_SYS_TIME_H)
37 CHECK_INCLUDE_FILES("netinet/in.h" HAVE_NETINET_IN_H)
38 CHECK_INCLUDE_FILES("netinet/tcp.h" HAVE_NETINET_TCP_H)
39 CHECK_INCLUDE_FILE_CXX("tr1/memory" HAVE_TR1_MEMORY)
40 CHECK_INCLUDE_FILE_CXX("tr1/unordered_map" HAVE_TR1_UNORDERED_MAP)
41 CHECK_INCLUDE_FILE_CXX("unordered_map" HAVE_UNORDERED_MAP)
42 CHECK_INCLUDE_FILE_CXX("atomic" HAVE_ATOMIC)
43 CHECK_INCLUDE_FILE_CXX("thread" HAVE_THREAD)
44
45 CHECK_FUNCTION_EXISTS(clock_gettime HAVE_CLOCK_GETTIME)
46 CHECK_FUNCTION_EXISTS(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME)
47 CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
48 CHECK_FUNCTION_EXISTS(getopt_long HAVE_GETOPT_LONG)
49
50 # ---- uncomment the lines below ONLY for dev/debugging ---
51 #if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
52 #    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
53 #elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
54 #    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
55 #endif()
56
57 IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
58    EXECUTE_PROCESS(COMMAND git rev-parse HEAD
59                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
60                    OUTPUT_VARIABLE EP_ENGINE_VERSION
61                    OUTPUT_STRIP_TRAILING_WHITESPACE)
62    IF (EP_ENGINE_VERSION STREQUAL "" OR EP_ENGINE_VERSION STREQUAL "HEAD")
63      MESSAGE (FATAL_ERROR "Failed to determine commit SHA!")
64    ENDIF (EP_ENGINE_VERSION STREQUAL "" OR EP_ENGINE_VERSION STREQUAL "HEAD")
65 ELSE (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
66    SET(EP_ENGINE_VERSION "unknown")
67 ENDIF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
68
69 CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/src/config.cmake.h
70                 ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)
71
72 # Generate the python wrappers
73 CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
74                 ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbepctl)
75 CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
76                 ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbstats)
77 CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
78                 ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbcompact)
79 CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
80                 ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvdiff)
81 CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
82                 ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvbucketctl)
83
84 IF (WIN32)
85    INCLUDE_DIRECTORIES(AFTER ${CMAKE_SOURCE_DIR}/platform/include/win32)
86 ENDIF (WIN32)
87
88 ADD_EXECUTABLE(gencode tools/gencode.cc)
89 TARGET_LINK_LIBRARIES(gencode cJSON platform)
90
91 ADD_EXECUTABLE(genconfig tools/genconfig.cc)
92 TARGET_LINK_LIBRARIES(genconfig cJSON platform)
93
94 ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.c
95                           ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.h
96                   COMMAND
97                      gencode -j ${CMAKE_CURRENT_SOURCE_DIR}/docs/stats.json -h ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.h -c ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.c -f get_stats_info
98                   DEPENDS
99                         docs/stats.json
100                         gencode
101                   COMMENT "Generating code for stats info")
102
103 ADD_CUSTOM_COMMAND(OUTPUT
104                      ${CMAKE_CURRENT_BINARY_DIR}/src/generated_configuration.cc
105                      ${CMAKE_CURRENT_BINARY_DIR}/src/generated_configuration.h
106                   COMMAND
107                      genconfig ${CMAKE_CURRENT_SOURCE_DIR}/configuration.json
108                   DEPENDS
109                         configuration.json
110                         genconfig
111                   COMMENT "Generating code for configuration class")
112
113 SET(KVSTORE_SOURCE src/crc32.c src/kvstore.cc src/mutation_log.cc)
114 SET(COUCH_KVSTORE_SOURCE src/couch-kvstore/couch-kvstore.cc
115             src/couch-kvstore/couch-fs-stats.cc)
116 SET(OBJECTREGISTRY_SOURCE src/objectregistry.cc)
117 SET(CONFIG_SOURCE src/configuration.cc
118   ${CMAKE_CURRENT_BINARY_DIR}/src/generated_configuration.cc)
119
120 ADD_LIBRARY(ep SHARED
121             src/access_scanner.cc src/atomic.cc src/backfill.cc
122             src/bgfetcher.cc src/bloomfilter.cc src/checkpoint.cc
123             src/checkpoint_remover.cc src/conflict_resolution.cc
124             src/dcp-backfill-manager.cc src/dcp-backfill.cc
125             src/dcp-consumer.cc src/dcp-producer.cc
126             src/dcp-stream.cc src/dcp-response.cc
127             src/defragmenter.cc
128             src/defragmenter_visitor.cc
129             src/ep.cc src/ep_engine.cc src/ep_time.c
130             src/executorpool.cc src/ext_meta_parser.cc
131             src/failover-table.cc src/flusher.cc src/htresizer.cc
132             src/item.cc src/item_pager.cc src/kvshard.cc
133             src/memory_tracker.cc src/murmurhash3.cc
134             src/mutex.cc src/priority.cc
135             src/executorthread.cc
136             src/sizes.cc
137             ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.c
138             src/stored-value.cc src/tapconnection.cc src/connmap.cc
139             src/tapthrottle.cc src/tasks.cc
140             src/taskqueue.cc src/vbucket.cc
141             src/vbucketmap.cc src/warmup.cc
142             ${KVSTORE_SOURCE} ${COUCH_KVSTORE_SOURCE}
143             ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
144
145 SET_TARGET_PROPERTIES(ep PROPERTIES PREFIX "")
146 TARGET_LINK_LIBRARIES(ep cJSON JSON_checker couchstore dirutils platform ${LIBEVENT_LIBRARIES})
147
148 IF (APPLE)
149     SET(MEMORY_TRACKING_SRCS ${Memcached_SOURCE_DIR}/daemon/alloc_hooks.c
150                              ${Memcached_SOURCE_DIR}/daemon/darwin_zone.c)
151 ELSE (APPLE)
152     SET(MEMORY_TRACKING_SRCS ${Memcached_SOURCE_DIR}/daemon/alloc_hooks.c)
153 ENDIF (APPLE)
154
155 IF (MEMORY_ALLOCATOR)
156     INCLUDE_DIRECTORIES(AFTER ${MALLOC_INCLUDE_DIR})
157 ELSE (MEMORY_ALLOCATOR)
158     SET(MALLOC_LIBRARIES "")
159 ENDIF (MEMORY_ALLOCATOR)
160
161 ADD_EXECUTABLE(ep-engine_stream_test
162   tests/module_tests/stream_test.cc
163   src/access_scanner.cc
164   src/atomic.cc
165   src/backfill.cc
166   src/bgfetcher.cc
167   src/bloomfilter.cc
168   src/checkpoint.cc
169   src/checkpoint_remover.cc
170   src/conflict_resolution.cc
171   src/connmap.cc
172   src/dcp-backfill.cc
173   src/dcp-backfill-manager.cc
174   src/dcp-consumer.cc
175   src/dcp-producer.cc
176   src/dcp-response.cc
177   src/dcp-stream.cc
178   src/defragmenter.cc
179   src/defragmenter_visitor.cc
180   src/ep.cc
181   src/ep_engine.cc
182   src/ep_time.c
183   src/executorpool.cc
184   src/executorthread.cc
185   src/ext_meta_parser.cc
186   src/failover-table.cc
187   src/flusher.cc
188   src/htresizer.cc
189   src/item.cc
190   src/item_pager.cc
191   src/kvshard.cc
192   src/memory_tracker.cc
193   src/murmurhash3.cc
194   src/mutation_log.cc
195   src/mutex.cc
196   src/objectregistry.cc
197   src/priority.cc
198   src/tapconnection.cc
199   src/stored-value.cc
200   src/tapthrottle.cc
201   src/tasks.cc
202   src/taskqueue.cc
203   src/vbucket.cc
204   src/vbucketmap.cc
205   src/warmup.cc
206   ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.c
207   ${CONFIG_SOURCE}
208   ${KVSTORE_SOURCE}
209   ${COUCH_KVSTORE_SOURCE}
210   ${MEMORY_TRACKING_SRCS}
211   ${Memcached_SOURCE_DIR}/programs/engine_testapp/mock_server.c)
212 TARGET_LINK_LIBRARIES(ep-engine_stream_test couchstore cJSON dirutils JSON_checker mcd_util platform ${MALLOC_LIBRARIES})
213
214 ADD_EXECUTABLE(ep-engine_atomic_ptr_test
215   tests/module_tests/atomic_ptr_test.cc
216   src/atomic.cc
217   src/testlogger.cc
218   src/mutex.cc)
219 TARGET_LINK_LIBRARIES(ep-engine_atomic_ptr_test platform)
220
221 ADD_EXECUTABLE(ep-engine_atomic_test
222   tests/module_tests/atomic_test.cc
223   src/testlogger.cc
224   src/mutex.cc)
225 TARGET_LINK_LIBRARIES(ep-engine_atomic_test platform)
226
227 ADD_EXECUTABLE(ep-engine_checkpoint_test
228   tests/module_tests/checkpoint_test.cc
229   src/bloomfilter.cc src/murmurhash3.cc
230   src/checkpoint.cc src/failover-table.cc
231   src/testlogger.cc src/stored-value.cc
232   src/atomic.cc src/mutex.cc
233   tests/module_tests/test_memory_tracker.cc
234   src/item.cc src/vbucket.cc
235   ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
236 TARGET_LINK_LIBRARIES(ep-engine_checkpoint_test ${SNAPPY_LIBRARIES} cJSON platform)
237
238 ADD_EXECUTABLE(ep-engine_chunk_creation_test
239   tests/module_tests/chunk_creation_test.cc)
240 TARGET_LINK_LIBRARIES(ep-engine_chunk_creation_test platform)
241
242 ADD_EXECUTABLE(ep-engine_hash_table_test
243   tests/module_tests/hash_table_test.cc src/item.cc
244   src/stored-value.cc
245   src/testlogger.cc src/atomic.cc src/mutex.cc
246   tests/module_tests/test_memory_tracker.cc
247   ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
248 TARGET_LINK_LIBRARIES(ep-engine_hash_table_test ${SNAPPY_LIBRARIES} platform)
249
250 ADD_EXECUTABLE(ep-engine_histo_test tests/module_tests/histo_test.cc)
251 TARGET_LINK_LIBRARIES(ep-engine_histo_test platform)
252 ADD_EXECUTABLE(ep-engine_hrtime_test tests/module_tests/hrtime_test.cc)
253 TARGET_LINK_LIBRARIES(ep-engine_hrtime_test platform)
254
255 ADD_EXECUTABLE(ep-engine_misc_test tests/module_tests/misc_test.cc)
256 TARGET_LINK_LIBRARIES(ep-engine_misc_test platform)
257 ADD_EXECUTABLE(ep-engine_mutex_test
258   tests/module_tests/mutex_test.cc src/testlogger.cc src/mutex.cc)
259 TARGET_LINK_LIBRARIES(ep-engine_mutex_test platform)
260
261 ADD_EXECUTABLE(ep-engine_priority_test  tests/module_tests/priority_test.cc src/priority.cc)
262 TARGET_LINK_LIBRARIES(ep-engine_priority_test platform)
263
264 ADD_EXECUTABLE(ep-engine_ringbuffer_test tests/module_tests/ringbuffer_test.cc)
265 TARGET_LINK_LIBRARIES(ep-engine_ringbuffer_test platform)
266
267 ADD_EXECUTABLE(ep-engine_failover_table_test tests/module_tests/failover_table_test.cc
268                         src/failover-table.cc src/mutex.cc src/testlogger.cc
269                         tests/module_tests/test_memory_tracker.cc
270                         ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
271 TARGET_LINK_LIBRARIES(ep-engine_failover_table_test cJSON platform)
272
273 ADD_EXECUTABLE(ep-engine_kvstore_test
274   tests/module_tests/kvstore_test.cc
275   src/access_scanner.cc
276   src/atomic.cc
277   src/backfill.cc
278   src/bgfetcher.cc
279   src/bloomfilter.cc
280   src/checkpoint.cc
281   src/checkpoint_remover.cc
282   src/conflict_resolution.cc
283   src/connmap.cc
284   src/dcp-backfill.cc
285   src/dcp-backfill-manager.cc
286   src/dcp-consumer.cc
287   src/dcp-producer.cc
288   src/dcp-response.cc
289   src/dcp-stream.cc
290   src/defragmenter.cc
291   src/defragmenter_visitor.cc
292   src/ep.cc
293   src/ep_engine.cc
294   src/ep_time.c
295   src/executorpool.cc
296   src/executorthread.cc
297   src/ext_meta_parser.cc
298   src/failover-table.cc
299   src/flusher.cc
300   src/htresizer.cc
301   src/item.cc
302   src/item_pager.cc
303   src/kvshard.cc
304   src/memory_tracker.cc
305   src/murmurhash3.cc
306   src/mutation_log.cc
307   src/mutex.cc
308   src/objectregistry.cc
309   src/priority.cc
310   src/tapconnection.cc
311   src/stored-value.cc
312   src/tapthrottle.cc
313   src/tasks.cc
314   src/taskqueue.cc
315   src/vbucket.cc
316   src/vbucketmap.cc
317   src/warmup.cc
318   ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.c
319   ${OBJECTREGISTRY_SOURCE}
320   ${KVSTORE_SOURCE}
321   ${COUCH_KVSTORE_SOURCE}
322   ${CONFIG_SOURCE})
323 TARGET_LINK_LIBRARIES(ep-engine_kvstore_test
324                       cJSON JSON_checker couchstore dirutils platform)
325
326 ADD_TEST(ep-engine_atomic_ptr_test ep-engine_atomic_ptr_test)
327 ADD_TEST(ep-engine_atomic_test ep-engine_atomic_test)
328 ADD_TEST(ep-engine_checkpoint_test ep-engine_checkpoint_test)
329 ADD_TEST(ep-engine_chunk_creation_test ep-engine_chunk_creation_test)
330 ADD_TEST(ep-engine_failover_table_test ep-engine_failover_table_test)
331 ADD_TEST(ep-engine_hash_table_test ep-engine_hash_table_test)
332 ADD_TEST(ep-engine_histo_test ep-engine_histo_test)
333 ADD_TEST(ep-engine_hrtime_test ep-engine_hrtime_test)
334 ADD_TEST(ep-engine_misc_test ep-engine_misc_test)
335 ADD_TEST(ep-engine_mutex_test ep-engine_mutex_test)
336 ADD_TEST(ep-engine_priority_test ep-engine_priority_test)
337 ADD_TEST(ep-engine_ringbuffer_test ep-engine_ringbuffer_test)
338 ADD_TEST(ep-engine_stream_test ep-engine_stream_test)
339 ADD_TEST(ep-engine_kvstore_test ep-engine_kvstore_test)
340
341 ADD_LIBRARY(timing_tests SHARED tests/module_tests/timing_tests.cc)
342 SET_TARGET_PROPERTIES(timing_tests PROPERTIES PREFIX "")
343 TARGET_LINK_LIBRARIES(timing_tests platform)
344
345 ADD_EXECUTABLE(ep-engine_sizes src/sizes.cc src/mutex.h src/mutex.cc src/testlogger.cc
346               ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
347 TARGET_LINK_LIBRARIES(ep-engine_sizes platform)
348
349 ADD_EXECUTABLE(ep-engine_defragmenter_test
350                tests/module_tests/defragmenter_test.cc
351                src/bloomfilter.cc
352                src/checkpoint.cc
353                src/configuration.cc
354                src/defragmenter_visitor.cc
355                src/ep_time.c
356                src/generated_configuration.cc
357                src/failover-table.cc
358                src/item.cc
359                src/murmurhash3.cc
360                src/mutex.cc
361                src/stored-value.cc
362                src/testlogger.cc
363                src/vbucket.cc
364                ${OBJECTREGISTRY_SOURCE})
365 TARGET_LINK_LIBRARIES(ep-engine_defragmenter_test cJSON platform ${SNAPPY_LIBRARIES})
366
367 ADD_LIBRARY(ep_testsuite SHARED
368    tests/ep_testsuite.cc
369    src/atomic.cc src/mutex.cc
370    src/item.cc src/testlogger.cc
371    src/ep_time.c src/ext_meta_parser.cc
372    tests/mock/mock_dcp.cc
373    tests/ep_test_apis.cc ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
374 SET_TARGET_PROPERTIES(ep_testsuite PROPERTIES PREFIX "")
375 TARGET_LINK_LIBRARIES(ep_testsuite couchstore dirutils JSON_checker platform
376                       ${LIBEVENT_LIBRARIES} ${SNAPPY_LIBRARIES})
377
378
379 #ADD_CUSTOM_COMMAND(OUTPUT
380 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_0.c
381 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_1.c
382 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_2.c
383 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_3.c
384 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_4.c
385 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_5.c
386 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_6.c
387 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_7.c
388 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_8.c
389 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_9.c
390 #                  COMMAND
391 #                     ${PYTHON_EXECUTABLE} tests/module_tests/gen_engine_test.py
392 #                  DEPENDS
393 #                        tests/module_tests/gen_engine_test.py
394 #                        tests/module_tests/breakdancer.py
395 #                  COMMENT "Generating testsuite")
396 #
397 #ADD_LIBRARY(generated_testsuite SHARED
398 #            tests/suite_stubs.c
399 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_0.c
400 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_1.c
401 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_2.c
402 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_3.c
403 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_4.c
404 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_5.c
405 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_6.c
406 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_7.c
407 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_8.c
408 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_9.c)
409
410 #SET_TARGET_PROPERTIES(generated_testsuite PROPERTIES PREFIX "")
411
412 INSTALL(PROGRAMS
413         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbepctl
414         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbstats
415         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbcompact
416         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvdiff
417         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvbucketctl
418         management/cbanalyze-core
419         DESTINATION bin)
420
421 INSTALL(PROGRAMS
422         management/cbepctl
423         management/cbstats
424         management/cbcompact
425         management/cbvdiff
426         management/cbvbucketctl
427         DESTINATION lib/python)
428
429 INSTALL(FILES
430         management/clitool.py
431         management/mc_bin_client.py
432         management/mc_bin_server.py
433         management/memcacheConstants.py
434         management/tap.py
435         management/tap_example.py
436         DESTINATION lib/python)
437
438 INSTALL(TARGETS ep
439         RUNTIME DESTINATION lib/memcached
440         LIBRARY DESTINATION lib/memcached
441         ARCHIVE DESTINATION lib/memcached)
442
443 ADD_CUSTOM_TARGET(engine-tests
444                   COMMAND ${CMAKE_BINARY_DIR}/memcached/engine_testapp -E ep.so -T ep_testsuite.so -e "flushall_enabled=true;ht_size=13;ht_locks=7"
445                   VERBATIM)
446
447 ADD_TEST(ep-engine-engine-tests ${CMAKE_BINARY_DIR}/memcached/engine_testapp -E ep.so -T ep_testsuite.so -e "flushall_enabled=true;ht_size=13;ht_locks=7" )
448 # ADD_TEST(ep-engine-breakdancer-engine-tests ${CMAKE_BINARY_DIR}/memcached/engine_testapp -E ep.so -T generated_testsuite.so -e 'flushall_enabled=true;ht_size=13;ht_locks=7;backend=couchdb')
449
450 ADD_CUSTOM_TARGET(test-valgrind
451                   COMMAND valgrind --log-file=valgrind.log
452                                    --tool=Memcheck
453                                    --num-callers=50
454                                    --error-limit=yes
455                                    --track-origins=yes
456                                    --malloc-fill=55
457                                    --free-fill=aa
458                                    --dsymutil=yes -q
459                                    ${CMAKE_BINARY_DIR}/memcached/engine_testapp
460                                          -E ep.so
461                                          -T ep_testsuite.so
462                                          -e "flushall_enabled=true;ht_size=13;ht_locks=7"
463                   DEPENDS
464                         ${CMAKE_BINARY_DIR}/memcached/engine_testapp
465                         ep
466                         ep_testsuite
467                   VERBATIM)