-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
68 lines (53 loc) · 1.43 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
cmake_minimum_required(VERSION 3.5)
project(mutiplex-distribution)
set(CMAKE_CXX_STANDARD 11)
add_definitions(-Wall)
include_directories(${CMAKE_SOURCE_DIR})
find_package(PkgConfig REQUIRED)
set(HEARERS
mutiplex/InetAddress.h
mutiplex/Timestamp.h
mutiplex/Slice.h
mutiplex/ByteBuffer.h
mutiplex/callbacks.h
mutiplex/Acceptor.h
mutiplex/CircularBuffer.h
mutiplex/Connection.h
mutiplex/EventLoop.h
mutiplex/ServerSocket.h
mutiplex/Connector.h
mutiplex/TcpServer.h
)
set(SRCS
src/EventSource.cpp
src/ByteBuffer.cpp
src/Timestamp.cpp
src/InetAddress.cpp
src/CircularBuffer.cpp
src/EventLoop.cpp
src/ServerSocket.cpp
src/Acceptor.cpp
src/TcpServer.cpp
src/Connection.cpp
src/Connector.cpp
)
add_library(mutiplex ${SRCS} ${HEARERS})
target_link_libraries(mutiplex ${LIBS})
pkg_check_modules(GoogleTest gtest gtest_main)
if (GoogleTest_FOUND)
include_directories(${GoogleTest_INCLUDE_DIRS})
set(LIBS
${LIBS} ${GoogleTest_LIBRARIES} pthread)
add_subdirectory(tests)
endif (GoogleTest_FOUND)
find_package(Boost COMPONENTS system thread)
if (Boost_FOUND)
set(LIBS
${LIBS} Boost::system Boost::thread)
add_subdirectory(benchmark/asio)
endif (Boost_FOUND)
add_subdirectory(benchmark/mutiplex)
install(TARGETS mutiplex
ARCHIVE DESTINATION lib)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/evcpp
DESTINATION include)