-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
40 lines (30 loc) · 946 Bytes
/
Copy pathCMakeLists.txt
File metadata and controls
40 lines (30 loc) · 946 Bytes
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
cmake_minimum_required(VERSION 3.10.0)
project(TinySQL VERSION 0.1.0 LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Add GoogleTest for testing
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
# Main project build
add_executable( TinySQL
src/main.cpp
src/table.h src/table.cpp
src/tokenizer.h src/tokenizer.cpp
src/parser.h src/parser.cpp
src/engine.h src/engine.cpp
src/printer.h src/printer.cpp
)
# Setup testing
enable_testing()
add_executable( UnitTest
tests/test_tokenizer.cpp src/tokenizer.h src/tokenizer.cpp
tests/test_parser.cpp src/parser.h src/parser.cpp
)
target_link_libraries(UnitTest GTest::gtest GTest::gtest_main)
include(GoogleTest)
gtest_discover_tests(UnitTest)