-
Notifications
You must be signed in to change notification settings - Fork 17
/
CMakeLists.txt
80 lines (67 loc) · 2.56 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/../platform/include
${CMAKE_CURRENT_SOURCE_DIR})
ADD_LIBRARY(vbucket SHARED
include/libvbucket/vbucket.h
include/libvbucket/visibility.h
src/crc32.c
src/hash.h
src/hash.h
src/ketama.c
src/rfc1321/global.h
src/rfc1321/md5.h
src/vbucket.c)
SET_TARGET_PROPERTIES(vbucket PROPERTIES SOVERSION 1.1.1)
SET_TARGET_PROPERTIES(vbucket PROPERTIES
COMPILE_FLAGS -DBUILDING_LIBVBUCKET=1)
SET_TARGET_PROPERTIES(vbucket PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)
IF (WIN32)
TARGET_LINK_LIBRARIES(vbucket cJSON)
ELSE (WIN32)
TARGET_LINK_LIBRARIES(vbucket cJSON m)
ENDIF (WIN32)
IF (INSTALL_HEADER_FILES)
INSTALL(FILES
include/libvbucket/vbucket.h
include/libvbucket/visibility.h
DESTINATION include/libvbucket)
ENDIF(INSTALL_HEADER_FILES)
INSTALL(TARGETS vbucket
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
ADD_EXECUTABLE(vbuckettool
include/libvbucket/vbucket.h
include/libvbucket/visibility.h
src/vbuckettool.c)
TARGET_LINK_LIBRARIES(vbuckettool vbucket)
ADD_EXECUTABLE(vbucketkeygen
include/libvbucket/vbucket.h
include/libvbucket/visibility.h
src/vbucketkeygen.c)
TARGET_LINK_LIBRARIES(vbucketkeygen vbucket)
#
# The tests. These are automatically executed as part of the build!
#
ADD_EXECUTABLE(libvbucket_testapp
include/libvbucket/vbucket.h
include/libvbucket/visibility.h
tests/macros.h
tests/testapp.c)
TARGET_LINK_LIBRARIES(libvbucket_testapp vbucket)
ADD_EXECUTABLE(libvbucket_regression
include/libvbucket/vbucket.h
include/libvbucket/visibility.h
tests/macros.h
tests/regression.c)
TARGET_LINK_LIBRARIES(libvbucket_regression vbucket)
ADD_EXECUTABLE(libvbucket_testketama
src/ketama.c
src/rfc1321/global.h
src/rfc1321/md5.h
tests/testketama.c)
TARGET_LINK_LIBRARIES(libvbucket_testketama vbucket)
ADD_TEST(libvbucket-basic-tests libvbucket_testapp ${CMAKE_CURRENT_SOURCE_DIR})
ADD_TEST(libvbucket-regression-tests libvbucket_regression ${CMAKE_CURRENT_SOURCE_DIR})
ADD_TEST(libvbucket-ketama-tests libvbucket_testketama)