-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
48 lines (37 loc) · 1.85 KB
/
CMakeLists.txt
File metadata and controls
48 lines (37 loc) · 1.85 KB
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
cmake_minimum_required(VERSION 3.16)
project(InMemoryDB)
set(CMAKE_CXX_STANDARD 17)
file(GLOB PARSER ${CMAKE_SOURCE_DIR}/parser/*.*)
file(GLOB PARSER_CONDITIONS ${CMAKE_SOURCE_DIR}/parser/conditions/*.*)
file(GLOB PARSER_OPERATORS ${CMAKE_SOURCE_DIR}/parser/operators/*.*)
file(GLOB PARSER_QUERY ${CMAKE_SOURCE_DIR}/parser/query/*.*)
file(GLOB PARSE_FACTORY ${CMAKE_SOURCE_DIR}/parser/parse_factory/*.*)
file(GLOB TABLE ${CMAKE_SOURCE_DIR}/table/*.*)
add_executable(sql main.cpp ${PARSER_CONDITIONS} ${PARSER} ${PARSER_OPERATORS} ${PARSE_FACTORY} ${PARSER_QUERY} ${TABLE} )
target_include_directories(sql PUBLIC
${CMAKE_SOURCE_DIR}/parser
${CMAKE_SOURCE_DIR}/parser/conditions
${CMAKE_SOURCE_DIR}/parser/operators
${CMAKE_SOURCE_DIR}/parser/query
${CMAKE_SOURCE_DIR}/table)
file(GLOB TESTS ${CMAKE_SOURCE_DIR}/tests/*.* ${CMAKE_SOURCE_DIR}/tests/tableTest/*.*)
include(FetchContent)
FetchContent_Declare(
googletest
# Specify the commit you depend on and update it regularly.
URL https://github.com/google/googletest/archive/5376968f6948923e2411081fd9372e71a59d8e77.zip)
FetchContent_MakeAvailable(googletest)
add_executable(unit_test ${TESTS} ${PARSER} ${PARSE_FACTORY} ${PARSER_CONDITIONS} ${PARSER_OPERATORS} ${PARSER_QUERY} ${TABLE})
target_link_libraries(unit_test gtest_main)
target_compile_options(unit_test PUBLIC
#-fsanitize=address
#-fsanitize-memory-track-origins=2
)
target_include_directories(unit_test PRIVATE ${gtest_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/parser
${CMAKE_SOURCE_DIR}/parser/conditions
${CMAKE_SOURCE_DIR}/parser/operators
${CMAKE_SOURCE_DIR}/parser/query
${CMAKE_SOURCE_DIR}/table)
add_test(NAME unit_test COMMAND unit_test)
#set_tests_properties(${noArgsTests} PROPERTIES TIMEOUT 10)
#set_tests_properties(${withArgsTests} PROPERTIES TIMEOUT 20)