-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
111 lines (92 loc) · 2.5 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
cmake_minimum_required(VERSION 3.14)
project(CP_ALGOS_DS)
# GoogleTest requires at least C++14
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
# Advanced-Data-Structures executable
add_executable(
advanced_data_structure_tests
tests/Advanced-Data-Structures/test_merge_sort_tree.cpp
tests/Advanced-Data-Structures/test_sparse_table.cpp
tests/Advanced-Data-Structures/test_sum_segTree_lazy_prop.cpp
tests/Advanced-Data-Structures/test_min_segTree_lazy_prop.cpp
tests/Advanced-Data-Structures/test_max_segTree_lazy_prop.cpp
tests/Advanced-Data-Structures/test_xor_segTree_lazy_prop.cpp
)
# Combinatorics
add_executable(
combinatorics_tests
tests/Combinatorics/test_general.cpp
)
# Tree tests executable
add_executable(
tree_tests
tests/Trees/Tries/test_tries.cpp
)
# Number Theory executable
add_executable(
number_theory_tests
tests/Number-Theory/test_prime_sieve.cpp
tests/Number-Theory/test_sieve_factorization.cpp
tests/Number-Theory/test_log_factorization.cpp
)
# Graph executable
add_executable(
graph_tests
tests/Graphs/Undirected/DSU/test_dsu.cpp
tests/Graphs/Directed/Binary-Lifting/test_kth_ancestor.cpp
tests/Graphs/Directed/Binary-Lifting/test_binary_lifting.cpp
)
# Strings executable
add_executable(
string_tests
tests/Strings/test_poly_hash.cpp
tests/Strings/test_rabinkarp.cpp
)
# Tree Tests
target_link_libraries(
tree_tests
GTest::gtest_main
)
# Number-Theory Tests
target_link_libraries(
number_theory_tests
GTest::gtest_main
)
# Advanced Data-Structure Tests
target_link_libraries(
advanced_data_structure_tests
GTest::gtest_main
)
# Combinatorics Tests
target_link_libraries(
combinatorics_tests
GTest::gtest_main
)
# Strings
target_link_libraries(
string_tests
GTest::gtest_main
)
# Graph tests
target_link_libraries(
graph_tests
GTest::gtest_main
)
include(GoogleTest)
include(Dart)
gtest_discover_tests(number_theory_tests)
gtest_discover_tests(graph_tests)
gtest_discover_tests(advanced_data_structure_tests)
gtest_discover_tests(string_tests)
gtest_discover_tests(tree_tests)
gtest_discover_tests(combinatorics_tests)