-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
71 lines (67 loc) · 1.46 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
cmake_minimum_required(VERSION 3.14)
project(CTddSqlLite)
# GoogleTest requires at least C++14
set(CMAKE_CXX_STANDARD 14)
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()
add_library(
parser
src/parser.c
src/parser.h
)
add_library(
command_reader
src/command_reader.c
src/command_reader.h
)
add_library(
repl
src/repl.c
src/repl.h
)
add_executable(
main
src/main.c
)
add_executable(
parser_test
tests/parser_test.cc
)
target_link_libraries(
main
repl
parser
command_reader
)
target_link_libraries(
parser_test
parser
GTest::gtest_main
)
add_executable(
fake_command_reader_test
tests/fake_command_reader_test.cc
)
add_library(
fake_command_reader
tests/fake_command_reader.cc
tests/fake_command_reader.h
)
target_link_libraries(
fake_command_reader_test
fake_command_reader
repl
parser
GTest::gtest_main
)
include(GoogleTest)
gtest_discover_tests(parser_test)
gtest_discover_tests(fake_command_reader_test)