MB-20307: Re-enable dcp ep_dcp_dead_conn_count
[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
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 # Single executable containing all class-level unit tests involving
162 # EventuallyPersistentEngine driven by GoogleTest.
163 # (We end up compiling most of the src/ files of ep-engine for these unit tests,
164 # so simpler / quicker just to link them into a single executable).
165 ADD_EXECUTABLE(ep-engine_ep_unit_tests
166   tests/mock/mock_dcp.cc
167   tests/module_tests/ep_unit_tests_main.cc
168   tests/module_tests/dcp_test.cc
169   tests/module_tests/evp_engine_test.cc
170   tests/module_tests/evp_store_test.cc
171   tests/module_tests/evp_store_single_threaded_test.cc
172   src/access_scanner.cc
173   src/atomic.cc
174   src/backfill.cc
175   src/bgfetcher.cc
176   src/bloomfilter.cc
177   src/checkpoint.cc
178   src/checkpoint_remover.cc
179   src/conflict_resolution.cc
180   src/connmap.cc
181   src/dcp-backfill.cc
182   src/dcp-backfill-manager.cc
183   src/dcp-consumer.cc
184   src/dcp-producer.cc
185   src/dcp-response.cc
186   src/dcp-stream.cc
187   src/defragmenter.cc
188   src/defragmenter_visitor.cc
189   src/ep.cc
190   src/ep_engine.cc
191   src/ep_time.c
192   src/executorpool.cc
193   src/executorthread.cc
194   src/ext_meta_parser.cc
195   src/failover-table.cc
196   src/flusher.cc
197   src/htresizer.cc
198   src/item.cc
199   src/item_pager.cc
200   src/kvshard.cc
201   src/memory_tracker.cc
202   src/murmurhash3.cc
203   src/mutation_log.cc
204   src/mutex.cc
205   src/objectregistry.cc
206   src/tapconnection.cc
207   src/stored-value.cc
208   src/tapthrottle.cc
209   src/tasks.cc
210   src/taskqueue.cc
211   src/vbucket.cc
212   src/vbucketmap.cc
213   src/warmup.cc
214   ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.c
215   ${CONFIG_SOURCE}
216   ${KVSTORE_SOURCE}
217   ${COUCH_KVSTORE_SOURCE}
218   ${MEMORY_TRACKING_SRCS}
219   ${Memcached_SOURCE_DIR}/programs/engine_testapp/mock_server.c)
220 TARGET_LINK_LIBRARIES(ep-engine_ep_unit_tests couchstore cJSON dirutils gtest JSON_checker mcd_util platform ${MALLOC_LIBRARIES})
221
222 ADD_EXECUTABLE(ep-engine_atomic_ptr_test
223   tests/module_tests/atomic_ptr_test.cc
224   src/atomic.cc
225   src/testlogger.cc
226   src/mutex.cc)
227 TARGET_LINK_LIBRARIES(ep-engine_atomic_ptr_test platform)
228
229 ADD_EXECUTABLE(ep-engine_atomic_test
230   tests/module_tests/atomic_test.cc
231   src/testlogger.cc
232   src/mutex.cc)
233 TARGET_LINK_LIBRARIES(ep-engine_atomic_test platform)
234
235 ADD_EXECUTABLE(ep-engine_checkpoint_test
236   tests/module_tests/checkpoint_test.cc
237   src/bloomfilter.cc src/murmurhash3.cc
238   src/checkpoint.cc src/failover-table.cc
239   src/testlogger.cc src/stored-value.cc
240   src/atomic.cc src/mutex.cc
241   tests/module_tests/test_memory_tracker.cc
242   src/item.cc src/vbucket.cc
243   ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
244 TARGET_LINK_LIBRARIES(ep-engine_checkpoint_test ${SNAPPY_LIBRARIES} cJSON platform)
245
246 ADD_EXECUTABLE(ep-engine_chunk_creation_test
247   tests/module_tests/chunk_creation_test.cc)
248 TARGET_LINK_LIBRARIES(ep-engine_chunk_creation_test platform)
249
250 ADD_EXECUTABLE(ep-engine_hash_table_test
251   tests/module_tests/hash_table_test.cc src/item.cc
252   src/stored-value.cc
253   src/testlogger.cc src/atomic.cc src/mutex.cc
254   tests/module_tests/test_memory_tracker.cc
255   ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
256 TARGET_LINK_LIBRARIES(ep-engine_hash_table_test ${SNAPPY_LIBRARIES} platform)
257
258 ADD_EXECUTABLE(ep-engine_histo_test tests/module_tests/histo_test.cc)
259 TARGET_LINK_LIBRARIES(ep-engine_histo_test platform)
260 ADD_EXECUTABLE(ep-engine_hrtime_test tests/module_tests/hrtime_test.cc)
261 TARGET_LINK_LIBRARIES(ep-engine_hrtime_test platform)
262
263 ADD_EXECUTABLE(ep-engine_misc_test tests/module_tests/misc_test.cc)
264 TARGET_LINK_LIBRARIES(ep-engine_misc_test platform)
265 ADD_EXECUTABLE(ep-engine_mutex_test
266   tests/module_tests/mutex_test.cc src/testlogger.cc src/mutex.cc)
267 TARGET_LINK_LIBRARIES(ep-engine_mutex_test platform)
268
269 ADD_EXECUTABLE(ep-engine_ringbuffer_test tests/module_tests/ringbuffer_test.cc)
270 TARGET_LINK_LIBRARIES(ep-engine_ringbuffer_test platform)
271
272 ADD_EXECUTABLE(ep-engine_failover_table_test tests/module_tests/failover_table_test.cc
273                         src/failover-table.cc src/mutex.cc src/testlogger.cc
274                         tests/module_tests/test_memory_tracker.cc
275                         ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
276 TARGET_LINK_LIBRARIES(ep-engine_failover_table_test cJSON platform)
277
278 ADD_EXECUTABLE(ep-engine_kvstore_test
279   tests/module_tests/kvstore_test.cc
280   src/access_scanner.cc
281   src/atomic.cc
282   src/backfill.cc
283   src/bgfetcher.cc
284   src/bloomfilter.cc
285   src/checkpoint.cc
286   src/checkpoint_remover.cc
287   src/conflict_resolution.cc
288   src/connmap.cc
289   src/dcp-backfill.cc
290   src/dcp-backfill-manager.cc
291   src/dcp-consumer.cc
292   src/dcp-producer.cc
293   src/dcp-response.cc
294   src/dcp-stream.cc
295   src/defragmenter.cc
296   src/defragmenter_visitor.cc
297   src/ep.cc
298   src/ep_engine.cc
299   src/ep_time.c
300   src/executorpool.cc
301   src/executorthread.cc
302   src/ext_meta_parser.cc
303   src/failover-table.cc
304   src/flusher.cc
305   src/htresizer.cc
306   src/item.cc
307   src/item_pager.cc
308   src/kvshard.cc
309   src/memory_tracker.cc
310   src/murmurhash3.cc
311   src/mutation_log.cc
312   src/mutex.cc
313   src/objectregistry.cc
314   src/tapconnection.cc
315   src/stored-value.cc
316   src/tapthrottle.cc
317   src/tasks.cc
318   src/taskqueue.cc
319   src/vbucket.cc
320   src/vbucketmap.cc
321   src/warmup.cc
322   ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.c
323   ${OBJECTREGISTRY_SOURCE}
324   ${KVSTORE_SOURCE}
325   ${COUCH_KVSTORE_SOURCE}
326   ${CONFIG_SOURCE})
327 TARGET_LINK_LIBRARIES(ep-engine_kvstore_test
328                       gmock gtest cJSON JSON_checker
329                       couchstore dirutils platform)
330
331 ADD_TEST(ep-engine_atomic_ptr_test ep-engine_atomic_ptr_test)
332 ADD_TEST(ep-engine_atomic_test ep-engine_atomic_test)
333 ADD_TEST(ep-engine_checkpoint_test ep-engine_checkpoint_test)
334 ADD_TEST(ep-engine_chunk_creation_test ep-engine_chunk_creation_test)
335 ADD_TEST(ep-engine_ep_unit_tests ep-engine_ep_unit_tests)
336 ADD_TEST(ep-engine_failover_table_test ep-engine_failover_table_test)
337 ADD_TEST(ep-engine_hash_table_test ep-engine_hash_table_test)
338 ADD_TEST(ep-engine_histo_test ep-engine_histo_test)
339 ADD_TEST(ep-engine_hrtime_test ep-engine_hrtime_test)
340 ADD_TEST(ep-engine_misc_test ep-engine_misc_test)
341 ADD_TEST(ep-engine_mutex_test ep-engine_mutex_test)
342 ADD_TEST(ep-engine_ringbuffer_test ep-engine_ringbuffer_test)
343 ADD_TEST(ep-engine_kvstore_test ep-engine_kvstore_test)
344
345 ADD_LIBRARY(timing_tests SHARED tests/module_tests/timing_tests.cc)
346 SET_TARGET_PROPERTIES(timing_tests PROPERTIES PREFIX "")
347 TARGET_LINK_LIBRARIES(timing_tests platform)
348
349 ADD_EXECUTABLE(ep-engine_sizes src/sizes.cc src/mutex.h src/mutex.cc src/testlogger.cc
350               ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
351 TARGET_LINK_LIBRARIES(ep-engine_sizes platform)
352
353 ADD_EXECUTABLE(ep-engine_defragmenter_test
354                tests/module_tests/defragmenter_test.cc
355                src/bloomfilter.cc
356                src/checkpoint.cc
357                src/configuration.cc
358                src/defragmenter_visitor.cc
359                src/ep_time.c
360                src/generated_configuration.cc
361                src/failover-table.cc
362                src/item.cc
363                src/murmurhash3.cc
364                src/mutex.cc
365                src/stored-value.cc
366                src/testlogger.cc
367                src/vbucket.cc
368                ${OBJECTREGISTRY_SOURCE})
369 TARGET_LINK_LIBRARIES(ep-engine_defragmenter_test cJSON platform ${SNAPPY_LIBRARIES})
370
371 ADD_LIBRARY(ep_testsuite SHARED
372    tests/ep_testsuite.cc
373    src/atomic.cc src/mutex.cc
374    src/item.cc src/testlogger.cc
375    src/ep_time.c src/ext_meta_parser.cc
376    tests/mock/mock_dcp.cc
377    tests/ep_test_apis.cc ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
378 SET_TARGET_PROPERTIES(ep_testsuite PROPERTIES PREFIX "")
379 TARGET_LINK_LIBRARIES(ep_testsuite couchstore dirutils JSON_checker platform
380                       ${LIBEVENT_LIBRARIES} ${SNAPPY_LIBRARIES})
381
382
383 #ADD_CUSTOM_COMMAND(OUTPUT
384 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_0.c
385 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_1.c
386 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_2.c
387 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_3.c
388 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_4.c
389 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_5.c
390 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_6.c
391 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_7.c
392 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_8.c
393 #                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_9.c
394 #                  COMMAND
395 #                     ${PYTHON_EXECUTABLE} tests/module_tests/gen_engine_test.py
396 #                  DEPENDS
397 #                        tests/module_tests/gen_engine_test.py
398 #                        tests/module_tests/breakdancer.py
399 #                  COMMENT "Generating testsuite")
400 #
401 #ADD_LIBRARY(generated_testsuite SHARED
402 #            tests/suite_stubs.c
403 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_0.c
404 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_1.c
405 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_2.c
406 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_3.c
407 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_4.c
408 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_5.c
409 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_6.c
410 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_7.c
411 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_8.c
412 #            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_9.c)
413
414 #SET_TARGET_PROPERTIES(generated_testsuite PROPERTIES PREFIX "")
415
416 INSTALL(PROGRAMS
417         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbepctl
418         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbstats
419         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbcompact
420         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvdiff
421         ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvbucketctl
422         management/cbanalyze-core
423         DESTINATION bin)
424
425 INSTALL(PROGRAMS
426         management/cbepctl
427         management/cbstats
428         management/cbcompact
429         management/cbvdiff
430         management/cbvbucketctl
431         DESTINATION lib/python)
432
433 INSTALL(FILES
434         management/clitool.py
435         management/mc_bin_client.py
436         management/mc_bin_server.py
437         management/memcacheConstants.py
438         management/tap.py
439         management/tap_example.py
440         DESTINATION lib/python)
441
442 INSTALL(TARGETS ep
443         RUNTIME DESTINATION lib/memcached
444         LIBRARY DESTINATION lib/memcached
445         ARCHIVE DESTINATION lib/memcached)
446
447 ADD_CUSTOM_TARGET(engine-tests
448                   COMMAND ${CMAKE_BINARY_DIR}/memcached/engine_testapp -E ep.so -T ep_testsuite.so -e "flushall_enabled=true;ht_size=13;ht_locks=7"
449                   VERBATIM)
450
451 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" )
452 # 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')
453
454 ADD_CUSTOM_TARGET(test-valgrind
455                   COMMAND valgrind --log-file=valgrind.log
456                                    --tool=Memcheck
457                                    --num-callers=50
458                                    --error-limit=yes
459                                    --track-origins=yes
460                                    --malloc-fill=55
461                                    --free-fill=aa
462                                    --dsymutil=yes -q
463                                    ${CMAKE_BINARY_DIR}/memcached/engine_testapp
464                                          -E ep.so
465                                          -T ep_testsuite.so
466                                          -e "flushall_enabled=true;ht_size=13;ht_locks=7"
467                   DEPENDS
468                         ${CMAKE_BINARY_DIR}/memcached/engine_testapp
469                         ep
470                         ep_testsuite
471                   VERBATIM)