-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
92 lines (81 loc) · 2.02 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
cmake_minimum_required(VERSION 3.25)
# set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_STANDARD 11)
list(APPEND CPP11_PROJECTS
a-very-big-sum
abstract-classes-polymorphism
balanced-brackets
big-sorting
birthday-cake-candles
c-tutorial-conditional-if-else
c-tutorial-for-loop
c-tutorial-functions
c-tutorial-pointer
caesar-cipher-1
coin-change
compare-the-triplets
countingsort1
crossword-puzzle
diagonal-difference
equal
fairy-chess
find-the-meidian
flipping-the-matrix
grid-challenge
jesse-and-cookies
lego-blocks
lonely-integer
merge-two-sorted-linked-lists
min-time
mini-max-sum
new-year-chaos
palindrome-index
plus-minus
queue-using-two-stacks
recursive-digit-sum
simple-array-sum
simple-text-editor
solve-me-first
staircase
swap_scores
the-power-sum
time-conversion
tower-breakers-1
tree-huffman-decoding
tree-preorder-traversal
truck-tour
tutorial-intro
zig-zag-sequence
)
foreach(proj ${CPP11_PROJECTS})
project(${proj})
message("building project ${proj}")
add_executable(${proj} ${proj}/${proj}.cpp)
target_link_libraries(${proj})
endforeach()
set(CMAKE_CXX_STANDARD 17)
list(APPEND CPP17_PROJECTS
c-tutorial-basic-data-types
)
foreach(proj ${CPP17_PROJECTS})
project(${proj})
message("building project ${proj}")
add_executable(${proj} ${proj}/${proj}.cpp)
target_link_libraries(${proj})
endforeach()
# Tests
project(tests)
enable_language(C CXX)
# enable_testing()
find_package(GTest REQUIRED)
# GoogleTest requires at least C++14
set(CMAKE_CXX_STANDARD 17)
file(GLOB_RECURSE TEST_FILES "*.cc")
list(FILTER TEST_FILES EXCLUDE REGEX "(build|\.history)")
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
enable_testing()
add_executable(tests ${TEST_FILES})
target_link_libraries(tests GTest::gtest_main)
include(GoogleTest)
gtest_discover_tests(tests)