forked from linux-fan-dave/redisclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (46 loc) · 1.4 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
cmake_minimum_required(VERSION 2.6)
PROJECT(RedisClient)
FIND_PACKAGE(Boost COMPONENTS unit_test_framework system REQUIRED)
SET(CMAKE_CXX_FLAGS "-W -Wall -Wextra -Wshadow -fPIC -pthread")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -DDEBUG ")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
SET(SOURCES
src/redisclient/impl/redisvalue.cpp
src/redisclient/impl/redissyncclient.cpp
src/redisclient/impl/redisparser.cpp
src/redisclient/impl/redisclientimpl.cpp
src/redisclient/impl/redisasyncclient.cpp
)
SET(HEADERS
src/redisclient/config.h
src/redisclient/version.h
src/redisclient/redisvalue.h
src/redisclient/redissyncclient.h
src/redisclient/redisparser.h
src/redisclient/redisclient.h
src/redisclient/redisbuffer.h
src/redisclient/redisasyncclient.h
src/redisclient/impl/redisclientimpl.h
)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src
${Boost_INCLUDE_DIRS}
)
ADD_EXECUTABLE(parsertest tests/parsertest.cpp ${SOURCES} ${HEADERS})
ADD_LIBRARY(redisclient STATIC ${HEADERS} ${SOURCES})
TARGET_LINK_LIBRARIES(parsertest
${Boost_LIBRARIES}
)
TARGET_LINK_LIBRARIES(redisclient
${Boost_LIBRARIES}
)
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src DESTINATION include)
ADD_CUSTOM_TARGET(test)
ADD_CUSTOM_COMMAND(TARGET test
POST_BUILD
COMMAND ./parsertest
COMMENT "Run tests"
VERBATIM
)
ADD_SUBDIRECTORY(examples)