-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
65 lines (54 loc) · 1.78 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
cmake_minimum_required(VERSION 3.15)
project(memlrc)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Threads REQUIRED)
# 设置头文件搜索路径
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/yalantinglibs/include
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/gf-complete/include
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/Jerasure/include/jerasure
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/Jerasure/include
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/hiredis/include
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/redis-plus-plus/include
)
# 设置库文件搜索路径
link_directories(
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/Jerasure/lib
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/gf-complete/lib
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/hiredis/lib
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/redis-plus-plus/lib
)
# 共享的源文件
set(SHARED_SOURCES
src/utils.cpp
src/erasure_code.cpp
src/tinyxml2.cpp
)
add_executable(run_client
src/client/client.cpp
src/client/run_client.cpp
${SHARED_SOURCES}
)
add_executable(run_coordinator
src/coordinator/coordinator.cpp
src/coordinator/run_coordinator.cpp
${SHARED_SOURCES}
)
add_executable(run_proxy
src/proxy/proxy.cpp
src/proxy/run_proxy.cpp
${SHARED_SOURCES}
)
add_executable(run_datanode
src/datanode/datanode.cpp
src/datanode/run_datanode.cpp
${SHARED_SOURCES}
)
target_link_libraries(run_client Threads::Threads Jerasure gf_complete redis++)
target_link_libraries(run_coordinator Threads::Threads Jerasure gf_complete redis++)
target_link_libraries(run_proxy Threads::Threads Jerasure gf_complete redis++)
target_link_libraries(run_datanode Threads::Threads Jerasure gf_complete redis++)