1133b726bSTrond NorbyePROJECT(EventuallyPersistentEngine)
2133b726bSTrond NorbyeCMAKE_MINIMUM_REQUIRED(VERSION 2.8)
3133b726bSTrond Norbye
4d8b5023cSTrond NorbyeINCLUDE(CheckFunctionExists)
5d8b5023cSTrond NorbyeINCLUDE(CheckIncludeFileCXX)
6d8b5023cSTrond NorbyeINCLUDE(CheckIncludeFiles)
7d8b5023cSTrond NorbyeINCLUDE(CheckLibraryExists)
8d8b5023cSTrond NorbyeINCLUDE(CheckSymbolExists)
9d8b5023cSTrond NorbyeINCLUDE(CheckTypeSize)
10d8b5023cSTrond Norbye
11c7d941ccSDave RigbyINCLUDE_DIRECTORIES(BEFORE ${CMAKE_INSTALL_PREFIX}/include
12c7d941ccSDave Rigby                           ${CMAKE_CURRENT_SOURCE_DIR}/include
137f6a4fd0STrond Norbye                           ${CMAKE_CURRENT_SOURCE_DIR}
14d8b5023cSTrond Norbye                           ${CMAKE_CURRENT_SOURCE_DIR}/src
157f6a4fd0STrond Norbye                           ${CMAKE_CURRENT_BINARY_DIR}/src
16c6ec2a48STrond Norbye                           ${SNAPPY_INCLUDE_DIR}
1744fb2b8aSTrond Norbye                           ${Platform_SOURCE_DIR}/include
1844fb2b8aSTrond Norbye                           ${Memcached_SOURCE_DIR}/include
1944fb2b8aSTrond Norbye                           ${Couchstore_SOURCE_DIR}/include
20c7d941ccSDave Rigby                           ${CMAKE_CURRENT_BINARY_DIR})
21d8b5023cSTrond Norbye
22d8b5023cSTrond NorbyeCHECK_INCLUDE_FILES("arpa/inet.h" HAVE_ARPA_INET_H)
2312260ea5STrond NorbyeCHECK_INCLUDE_FILES("unistd.h" HAVE_UNISTD_H)
24d8b5023cSTrond NorbyeCHECK_INCLUDE_FILES("netdb.h" HAVE_NETDB_H)
25d8b5023cSTrond NorbyeCHECK_INCLUDE_FILES("mach/mach_time.h" HAVE_MACH_MACH_TIME_H)
2651f7556cSTrond NorbyeCHECK_INCLUDE_FILES("poll.h" HAVE_POLL_H)
27d8b5023cSTrond NorbyeCHECK_INCLUDE_FILES("atomic.h" HAVE_ATOMIC_H)
28d8b5023cSTrond NorbyeCHECK_INCLUDE_FILES("sysexits.h" HAVE_SYSEXITS_H)
29d8b5023cSTrond NorbyeCHECK_INCLUDE_FILES("unistd.h" HAVE_UNISTD_H)
30d8b5023cSTrond NorbyeCHECK_INCLUDE_FILES("sched.h" HAVE_SCHED_H)
31d8b5023cSTrond NorbyeCHECK_INCLUDE_FILES("sys/socket.h" HAVE_SYS_SOCKET_H)
32d8b5023cSTrond NorbyeCHECK_INCLUDE_FILES("sys/time.h" HAVE_SYS_TIME_H)
33d8b5023cSTrond NorbyeCHECK_INCLUDE_FILES("netinet/in.h" HAVE_NETINET_IN_H)
34d8b5023cSTrond NorbyeCHECK_INCLUDE_FILES("netinet/tcp.h" HAVE_NETINET_TCP_H)
35d8b5023cSTrond NorbyeCHECK_INCLUDE_FILE_CXX("tr1/memory" HAVE_TR1_MEMORY)
36d8b5023cSTrond NorbyeCHECK_INCLUDE_FILE_CXX("tr1/unordered_map" HAVE_TR1_UNORDERED_MAP)
371f8ad652STrond NorbyeCHECK_INCLUDE_FILE_CXX("unordered_map" HAVE_UNORDERED_MAP)
382f7dd3ecSTrond NorbyeCHECK_INCLUDE_FILE_CXX("atomic" HAVE_ATOMIC)
392f7dd3ecSTrond NorbyeCHECK_INCLUDE_FILE_CXX("thread" HAVE_THREAD)
40d8b5023cSTrond Norbye
41d8b5023cSTrond NorbyeCHECK_FUNCTION_EXISTS(clock_gettime HAVE_CLOCK_GETTIME)
42d8b5023cSTrond NorbyeCHECK_FUNCTION_EXISTS(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME)
43d8b5023cSTrond NorbyeCHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
44d8b5023cSTrond NorbyeCHECK_FUNCTION_EXISTS(getopt_long HAVE_GETOPT_LONG)
45d8b5023cSTrond Norbye
461172eb5dSSundar Sridharan# ---- uncomment the lines below ONLY for dev/debugging ---
471172eb5dSSundar Sridharan#if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
481172eb5dSSundar Sridharan#    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
491172eb5dSSundar Sridharan#elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
501172eb5dSSundar Sridharan#    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
511172eb5dSSundar Sridharan#endif()
521172eb5dSSundar Sridharan
532f2db2c1STrond NorbyeIF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
54ea7d2691STrond Norbye   EXECUTE_PROCESS(COMMAND git describe
55ea7d2691STrond Norbye                   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
56ea7d2691STrond Norbye                   OUTPUT_VARIABLE EP_ENGINE_VERSION
57ea7d2691STrond Norbye                   ERROR_QUIET
58ea7d2691STrond Norbye                   OUTPUT_STRIP_TRAILING_WHITESPACE)
592f2db2c1STrond NorbyeELSE (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
60ea7d2691STrond Norbye   SET(EP_ENGINE_VERSION "unknown")
612f2db2c1STrond NorbyeENDIF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
62a8ba2968STrond Norbye
63d8b5023cSTrond NorbyeCONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/src/config.cmake.h
64d8b5023cSTrond Norbye                ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)
65d8b5023cSTrond Norbye
66d8b5023cSTrond Norbye# Generate the python wrappers
671bd7de88STrond NorbyeCONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
68d8b5023cSTrond Norbye                ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbadm-tap-registration)
691bd7de88STrond NorbyeCONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
70d8b5023cSTrond Norbye                ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbepctl)
711bd7de88STrond NorbyeCONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
72d8b5023cSTrond Norbye                ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbstats)
731bd7de88STrond NorbyeCONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
74d8b5023cSTrond Norbye                ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbcompact)
7599b8c1b8SSundar SridharanCONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
7699b8c1b8SSundar Sridharan                ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvdiff)
771bd7de88STrond NorbyeCONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/wrapper/wrapper
78d8b5023cSTrond Norbye                ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvbucketctl)
79d8b5023cSTrond Norbye
808462ae7bSTrond NorbyeIF (WIN32)
818462ae7bSTrond Norbye   INCLUDE_DIRECTORIES(AFTER ${CMAKE_SOURCE_DIR}/platform/include/win32)
828462ae7bSTrond NorbyeENDIF (WIN32)
838462ae7bSTrond Norbye
847e078dfaSTrond NorbyeADD_EXECUTABLE(gencode tools/gencode.cc)
857e078dfaSTrond NorbyeTARGET_LINK_LIBRARIES(gencode cJSON platform)
867e078dfaSTrond Norbye
877e078dfaSTrond NorbyeADD_EXECUTABLE(genconfig tools/genconfig.cc)
887e078dfaSTrond NorbyeTARGET_LINK_LIBRARIES(genconfig cJSON platform)
89d8b5023cSTrond Norbye
90d8b5023cSTrond NorbyeADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.c
91d8b5023cSTrond Norbye                          ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.h
92d8b5023cSTrond Norbye                  COMMAND
93fc0035b4Sjim                     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
94d8b5023cSTrond Norbye                  DEPENDS
95d8b5023cSTrond Norbye                        docs/stats.json
96fc0035b4Sjim                        gencode
97d8b5023cSTrond Norbye                  COMMENT "Generating code for stats info")
98d8b5023cSTrond Norbye
99d8b5023cSTrond NorbyeADD_CUSTOM_COMMAND(OUTPUT
100d8b5023cSTrond Norbye                     ${CMAKE_CURRENT_BINARY_DIR}/src/generated_configuration.cc
101d8b5023cSTrond Norbye                     ${CMAKE_CURRENT_BINARY_DIR}/src/generated_configuration.h
102d8b5023cSTrond Norbye                  COMMAND
103fc0035b4Sjim                     genconfig ${CMAKE_CURRENT_SOURCE_DIR}/configuration.json
104d8b5023cSTrond Norbye                  DEPENDS
105d8b5023cSTrond Norbye                        configuration.json
106fc0035b4Sjim                        genconfig
107d8b5023cSTrond Norbye                  COMMENT "Generating code for configuration class")
108d8b5023cSTrond Norbye
109d8b5023cSTrond NorbyeSET(KVSTORE_SOURCE src/crc32.c src/kvstore.cc src/mutation_log.cc)
110d8b5023cSTrond NorbyeSET(COUCH_KVSTORE_SOURCE src/couch-kvstore/couch-kvstore.cc
111d8d0da1fSabhinavdangeti            src/couch-kvstore/couch-fs-stats.cc)
112d8b5023cSTrond NorbyeSET(OBJECTREGISTRY_SOURCE src/objectregistry.cc)
113d8b5023cSTrond NorbyeSET(CONFIG_SOURCE src/configuration.cc
114d8b5023cSTrond Norbye  ${CMAKE_CURRENT_BINARY_DIR}/src/generated_configuration.cc)
115d8b5023cSTrond Norbye
116d8b5023cSTrond NorbyeADD_LIBRARY(ep SHARED
117d8b5023cSTrond Norbye            src/access_scanner.cc src/atomic.cc src/backfill.cc
118d8b5023cSTrond Norbye            src/bgfetcher.cc src/checkpoint.cc
119d8b5023cSTrond Norbye            src/checkpoint_remover.cc src/conflict_resolution.cc
120c7feb12aSMike Wiederhold            src/ep.cc src/ep_engine.cc src/ep_time.c
121cc392fe4STrond Norbye            src/executorpool.cc src/failover-table.cc
122a5db9f75SSundar Sridharan            src/flusher.cc src/htresizer.cc
123d8b5023cSTrond Norbye            src/item.cc src/item_pager.cc src/kvshard.cc
124d8b5023cSTrond Norbye            src/memory_tracker.cc src/mutex.cc src/priority.cc
12592a22a9eSabhinavdangeti            src/executorthread.cc
12692a22a9eSabhinavdangeti            src/sizes.cc
127d8b5023cSTrond Norbye            ${CMAKE_CURRENT_BINARY_DIR}/src/stats-info.c
1283e9ca12cSMike Wiederhold            src/stored-value.cc src/tapconnection.cc src/connmap.cc
129e32900fbSTrond Norbye            src/tapthrottle.cc src/tasks.cc
130e32900fbSTrond Norbye            src/taskqueue.cc
1315ad7924aSMike Wiederhold            src/dcp-response.cc src/dcp-consumer.cc
1325ad7924aSMike Wiederhold            src/dcp-producer.cc src/dcp-stream.cc src/vbucket.cc
13303e054ffSMike Wiederhold            src/vbucketmap.cc src/warmup.cc
134d8b5023cSTrond Norbye            ${KVSTORE_SOURCE} ${COUCH_KVSTORE_SOURCE}
135a9bc0ba9STrond Norbye            ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
136d8b5023cSTrond Norbye
137d8b5023cSTrond NorbyeSET_TARGET_PROPERTIES(ep PROPERTIES PREFIX "")
138296cee9eSTrond NorbyeTARGET_LINK_LIBRARIES(ep cJSON JSON_checker couchstore dirutils platform ${LIBEVENT_LIBRARIES})
139d8b5023cSTrond Norbye
140d8b5023cSTrond NorbyeADD_EXECUTABLE(ep-engine_atomic_ptr_test
141d8b5023cSTrond Norbye  tests/module_tests/atomic_ptr_test.cc
142d8b5023cSTrond Norbye  src/atomic.cc
143d8b5023cSTrond Norbye  src/testlogger.cc
144d8b5023cSTrond Norbye  src/mutex.cc)
145d8b5023cSTrond NorbyeTARGET_LINK_LIBRARIES(ep-engine_atomic_ptr_test platform)
146d8b5023cSTrond Norbye
147d8b5023cSTrond NorbyeADD_EXECUTABLE(ep-engine_atomic_test
148d8b5023cSTrond Norbye  tests/module_tests/atomic_test.cc
149d8b5023cSTrond Norbye  src/testlogger.cc
150d8b5023cSTrond Norbye  src/mutex.cc)
151d8b5023cSTrond NorbyeTARGET_LINK_LIBRARIES(ep-engine_atomic_test platform)
152d8b5023cSTrond Norbye
153d8b5023cSTrond NorbyeADD_EXECUTABLE(ep-engine_checkpoint_test
154d8b5023cSTrond Norbye  tests/module_tests/checkpoint_test.cc
155cc392fe4STrond Norbye  src/checkpoint.cc src/failover-table.cc
156d8b5023cSTrond Norbye  src/testlogger.cc src/stored-value.cc
157d8b5023cSTrond Norbye  src/atomic.cc src/mutex.cc
158d8b5023cSTrond Norbye  tests/module_tests/test_memory_tracker.cc
159d8b5023cSTrond Norbye  src/item.cc src/vbucket.cc
160d8b5023cSTrond Norbye  ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
16182a6f303SabhinavdangetiTARGET_LINK_LIBRARIES(ep-engine_checkpoint_test ${SNAPPY_LIBRARIES} cJSON platform)
162d8b5023cSTrond Norbye
163d8b5023cSTrond NorbyeADD_EXECUTABLE(ep-engine_chunk_creation_test
164d8b5023cSTrond Norbye  tests/module_tests/chunk_creation_test.cc)
165d8b5023cSTrond Norbye
166d8b5023cSTrond NorbyeADD_EXECUTABLE(ep-engine_hash_table_test
167d8b5023cSTrond Norbye  tests/module_tests/hash_table_test.cc src/item.cc
168d8b5023cSTrond Norbye  src/stored-value.cc
169d8b5023cSTrond Norbye  src/testlogger.cc src/atomic.cc src/mutex.cc
170d8b5023cSTrond Norbye  tests/module_tests/test_memory_tracker.cc
171439d58efSAliaksey Artamonau  ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
17282a6f303SabhinavdangetiTARGET_LINK_LIBRARIES(ep-engine_hash_table_test ${SNAPPY_LIBRARIES} platform)
173d8b5023cSTrond Norbye
174d8b5023cSTrond NorbyeADD_EXECUTABLE(ep-engine_histo_test tests/module_tests/histo_test.cc)
175d8b5023cSTrond NorbyeADD_EXECUTABLE(ep-engine_hrtime_test tests/module_tests/hrtime_test.cc)
176d8b5023cSTrond NorbyeTARGET_LINK_LIBRARIES(ep-engine_hrtime_test platform)
177d8b5023cSTrond Norbye
178d8b5023cSTrond NorbyeADD_EXECUTABLE(ep-engine_misc_test tests/module_tests/misc_test.cc)
179d8b5023cSTrond NorbyeADD_EXECUTABLE(ep-engine_mutex_test
180d8b5023cSTrond Norbye  tests/module_tests/mutex_test.cc src/testlogger.cc src/mutex.cc)
181d8b5023cSTrond NorbyeTARGET_LINK_LIBRARIES(ep-engine_mutex_test platform)
182d8b5023cSTrond Norbye
183d8b5023cSTrond NorbyeADD_EXECUTABLE(ep-engine_priority_test  tests/module_tests/priority_test.cc
184d8b5023cSTrond Norbye                        src/priority.cc)
185d8b5023cSTrond NorbyeADD_EXECUTABLE(ep-engine_ringbuffer_test tests/module_tests/ringbuffer_test.cc)
186d8b5023cSTrond Norbye
1873d30bba5SMike WiederholdADD_EXECUTABLE(ep-engine_failover_table_test tests/module_tests/failover_table_test.cc
1883d30bba5SMike Wiederhold                        src/failover-table.cc src/mutex.cc src/testlogger.cc
1893d30bba5SMike Wiederhold                        tests/module_tests/test_memory_tracker.cc
190d08b431bSAliaksey Artamonau                        ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
1913d30bba5SMike WiederholdTARGET_LINK_LIBRARIES(ep-engine_failover_table_test cJSON platform)
1923d30bba5SMike Wiederhold
193d8b5023cSTrond NorbyeADD_TEST(ep-engine_atomic_ptr_test ep-engine_atomic_ptr_test)
194d8b5023cSTrond NorbyeADD_TEST(ep-engine_atomic_test ep-engine_atomic_test)
195d8b5023cSTrond NorbyeADD_TEST(ep-engine_checkpoint_test ep-engine_checkpoint_test)
196d8b5023cSTrond NorbyeADD_TEST(ep-engine_chunk_creation_test ep-engine_chunk_creation_test)
1973d30bba5SMike WiederholdADD_TEST(ep-engine_failover_table_test ep-engine_failover_table_test)
198d8b5023cSTrond NorbyeADD_TEST(ep-engine_hash_table_test ep-engine_hash_table_test)
199d8b5023cSTrond NorbyeADD_TEST(ep-engine_histo_test ep-engine_histo_test)
200d8b5023cSTrond NorbyeADD_TEST(ep-engine_hrtime_test ep-engine_hrtime_test)
201d8b5023cSTrond NorbyeADD_TEST(ep-engine_misc_test ep-engine_misc_test)
202d8b5023cSTrond NorbyeADD_TEST(ep-engine_mutex_test ep-engine_mutex_test)
203d8b5023cSTrond NorbyeADD_TEST(ep-engine_priority_test ep-engine_priority_test)
204d8b5023cSTrond NorbyeADD_TEST(ep-engine_ringbuffer_test ep-engine_ringbuffer_test)
205d8b5023cSTrond Norbye
206d8b5023cSTrond NorbyeADD_LIBRARY(timing_tests SHARED tests/module_tests/timing_tests.cc)
207d8b5023cSTrond NorbyeSET_TARGET_PROPERTIES(timing_tests PROPERTIES PREFIX "")
208d0d91da7STrond NorbyeTARGET_LINK_LIBRARIES(timing_tests platform)
209d8b5023cSTrond Norbye
210439d58efSAliaksey ArtamonauADD_EXECUTABLE(ep-engine_sizes src/sizes.cc src/mutex.h src/mutex.cc src/testlogger.cc
211439d58efSAliaksey Artamonau              ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
212d8b5023cSTrond NorbyeTARGET_LINK_LIBRARIES(ep-engine_sizes platform)
213d8b5023cSTrond Norbye
214d8b5023cSTrond NorbyeADD_LIBRARY(ep_testsuite SHARED
215d8b5023cSTrond Norbye   tests/ep_testsuite.cc
216d8b5023cSTrond Norbye   src/atomic.cc src/mutex.cc
217d8b5023cSTrond Norbye   src/item.cc src/testlogger.cc
218c7feb12aSMike Wiederhold   src/ep_time.c
2195ad7924aSMike Wiederhold   tests/mock/mock_dcp.cc
220439d58efSAliaksey Artamonau   tests/ep_test_apis.cc ${OBJECTREGISTRY_SOURCE} ${CONFIG_SOURCE})
221d8b5023cSTrond NorbyeSET_TARGET_PROPERTIES(ep_testsuite PROPERTIES PREFIX "")
222c8f54d3eSabhinavdangetiTARGET_LINK_LIBRARIES(ep_testsuite JSON_checker dirutils platform ${LIBEVENT_LIBRARIES} ${SNAPPY_LIBRARIES})
223d8b5023cSTrond Norbye
224d8b5023cSTrond Norbye
225720d5622STrond Norbye#ADD_CUSTOM_COMMAND(OUTPUT
226720d5622STrond Norbye#                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_0.c
227720d5622STrond Norbye#                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_1.c
228720d5622STrond Norbye#                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_2.c
229720d5622STrond Norbye#                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_3.c
230720d5622STrond Norbye#                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_4.c
231720d5622STrond Norbye#                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_5.c
232720d5622STrond Norbye#                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_6.c
233720d5622STrond Norbye#                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_7.c
234720d5622STrond Norbye#                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_8.c
235720d5622STrond Norbye#                     ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_9.c
236720d5622STrond Norbye#                  COMMAND
237720d5622STrond Norbye#                     ${PYTHON_EXECUTABLE} tests/module_tests/gen_engine_test.py
238720d5622STrond Norbye#                  DEPENDS
239720d5622STrond Norbye#                        tests/module_tests/gen_engine_test.py
240720d5622STrond Norbye#                        tests/module_tests/breakdancer.py
241720d5622STrond Norbye#                  COMMENT "Generating testsuite")
242720d5622STrond Norbye#
243720d5622STrond Norbye#ADD_LIBRARY(generated_testsuite SHARED
244720d5622STrond Norbye#            tests/suite_stubs.c
245720d5622STrond Norbye#            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_0.c
246720d5622STrond Norbye#            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_1.c
247720d5622STrond Norbye#            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_2.c
248720d5622STrond Norbye#            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_3.c
249720d5622STrond Norbye#            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_4.c
250720d5622STrond Norbye#            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_5.c
251720d5622STrond Norbye#            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_6.c
252720d5622STrond Norbye#            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_7.c
253720d5622STrond Norbye#            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_8.c
254720d5622STrond Norbye#            ${CMAKE_CURRENT_BINARY_DIR}/generated_suite_9.c)
255720d5622STrond Norbye
256720d5622STrond Norbye#SET_TARGET_PROPERTIES(generated_testsuite PROPERTIES PREFIX "")
257d8b5023cSTrond Norbye
258d8b5023cSTrond NorbyeINSTALL(PROGRAMS
259d8b5023cSTrond Norbye        ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbadm-tap-registration
260d8b5023cSTrond Norbye        ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbepctl
261d8b5023cSTrond Norbye        ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbstats
262d8b5023cSTrond Norbye        ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbcompact
26399b8c1b8SSundar Sridharan        ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvdiff
264d8b5023cSTrond Norbye        ${CMAKE_CURRENT_BINARY_DIR}/wrapper/cbvbucketctl
265d8b5023cSTrond Norbye        management/cbanalyze-core
266d8b5023cSTrond Norbye        DESTINATION bin)
267d8b5023cSTrond Norbye
268d8b5023cSTrond NorbyeINSTALL(PROGRAMS
269d8b5023cSTrond Norbye        management/cbadm-tap-registration
270d8b5023cSTrond Norbye        management/cbepctl
271d8b5023cSTrond Norbye        management/cbstats
272d8b5023cSTrond Norbye        management/cbcompact
27399b8c1b8SSundar Sridharan        management/cbvdiff
274d8b5023cSTrond Norbye        management/cbvbucketctl
275d8b5023cSTrond Norbye        DESTINATION lib/python)
276d8b5023cSTrond Norbye
277d8b5023cSTrond NorbyeINSTALL(FILES
278d8b5023cSTrond Norbye        management/clitool.py
279d8b5023cSTrond Norbye        management/mc_bin_client.py
280d8b5023cSTrond Norbye        management/mc_bin_server.py
281d8b5023cSTrond Norbye        management/memcacheConstants.py
282d8b5023cSTrond Norbye        management/tap.py
283d8b5023cSTrond Norbye        management/tap_example.py
284d8b5023cSTrond Norbye        DESTINATION lib/python)
285d8b5023cSTrond Norbye
286d8b5023cSTrond NorbyeINSTALL(TARGETS ep
287ab287e5eSTrond Norbye        RUNTIME DESTINATION lib/memcached
288d8b5023cSTrond Norbye        LIBRARY DESTINATION lib/memcached
289d8b5023cSTrond Norbye        ARCHIVE DESTINATION lib/memcached)
290d8b5023cSTrond Norbye
29177c82f60STrond NorbyeADD_CUSTOM_TARGET(engine-tests
2929d2a9979STrond Norbye                  COMMAND ${CMAKE_BINARY_DIR}/memcached/engine_testapp -E ep.so -T ep_testsuite.so -e "flushall_enabled=true;ht_size=13;ht_locks=7"
29377c82f60STrond Norbye                  VERBATIM)
294d8b5023cSTrond Norbye
29529849d03SSundar SridharanADD_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" )
2969d2a9979STrond Norbye# 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')
2979d2a9979STrond Norbye
2989d2a9979STrond NorbyeADD_CUSTOM_TARGET(test-valgrind
2999d2a9979STrond Norbye                  COMMAND valgrind --log-file=valgrind.log
3009d2a9979STrond Norbye                                   --tool=Memcheck
3019d2a9979STrond Norbye                                   --num-callers=50
3029d2a9979STrond Norbye                                   --error-limit=yes
3039d2a9979STrond Norbye                                   --track-origins=yes
3049d2a9979STrond Norbye                                   --malloc-fill=55
3059d2a9979STrond Norbye                                   --free-fill=aa
3069d2a9979STrond Norbye                                   --dsymutil=yes -q
3079d2a9979STrond Norbye                                   ${CMAKE_BINARY_DIR}/memcached/engine_testapp
3089d2a9979STrond Norbye                                         -E ep.so
3099d2a9979STrond Norbye                                         -T ep_testsuite.so
3109d2a9979STrond Norbye                                         -e "flushall_enabled=true;ht_size=13;ht_locks=7"
3119d2a9979STrond Norbye                  DEPENDS
3129d2a9979STrond Norbye                        ${CMAKE_BINARY_DIR}/memcached/engine_testapp
3139d2a9979STrond Norbye                        ep
3149d2a9979STrond Norbye                        ep_testsuite
3159d2a9979STrond Norbye                  VERBATIM)
316