-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
80 lines (68 loc) · 1.67 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
cmake_minimum_required (VERSION 3.12)
project (GraphEX)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++17 -pthread")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(3RDPARTY_INCLUDE_DIRS)
set(3RDPARTY_LIBRARIES)
set(RUN_BENCHMARK)
enable_testing()
find_package(GTest REQUIRED)
list(APPEND 3RDPARTY_INCLUDE_DIRS "${GTEST_INCLUDE_DIRS}")
list(APPEND 3RDPARTY_LIBRARIES "${GTEST_BOTH_LIBRARIES}")
find_package(Boost REQUIRED COMPONENTS thread program_options)
file(GLOB_RECURSE test_files
"${CMAKE_CURRENT_SOURCE_DIR}/test.cpp"
)
add_executable(graph_test
${test_files}
)
target_include_directories(
graph_test
PRIVATE
${3RDPARTY_INCLUDE_DIRS}
"{CMAKE_CURRENT_SOURCE_DIR}"
"${Boost_INCLUDE_DIR}"
"${BOOST_LOCKFREE_DIR}"
)
target_link_libraries(
graph_test
${3RDPARTY_LIBRARIES}
)
#[[
target_compile_definitions(
graph_test
PUBLIC
"USE_BOOST_LOCKLESS_Q"
)
]]
if ("${RUN_BENCHMARK}" STREQUAL "ON")
find_package(benchmark REQUIRED)
add_executable(bmark
${CMAKE_SOURCE_DIR}/benchmark.cpp
)
target_include_directories(bmark
PUBLIC
"${GOOGLE_BENCHMARK_SRC}/include"
"{CMAKE_CURRENT_SOURCE_DIR}"
"${Boost_INCLUDE_DIR}"
"${BOOST_LOCKFREE_DIR}"
)
#[[
target_compile_definitions(
bmark
PUBLIC
"USE_BOOST_LOCKLESS_Q"
)
]]
target_link_libraries(bmark
PUBLIC
benchmark::benchmark
)
endif()