-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (50 loc) · 1.42 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
cmake_minimum_required(VERSION 3.24)
project(spreadsheet LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
# ANTLR
set(ANTLR_EXECUTABLE /usr/share/java/antlr-complete.jar)
set(ANLTR_LIBRARY /usr/lib/libantlr4-runtime.a)
include_directories(
/usr/include/antlr4-runtime
)
include(${CMAKE_CURRENT_SOURCE_DIR}/antlr/FindANTLR.cmake)
add_definitions(
-DANTLR4CPP_STATIC
-D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
)
antlr_target(FormulaParser antlr/Formula.g4 LEXER PARSER LISTENER)
file(GLOB ANTLR_OUTPUT
antlr/Formula/*.cpp
antlr/Formula/*.h
)
# Doxygen
find_package(Doxygen)
if (DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doxygen
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs)
endif ()
add_executable(
spreadsheet
${ANTLR_OUTPUT}
)
target_link_libraries(spreadsheet ${ANLTR_LIBRARY})
add_executable(
unit-tests
${ANTLR_OUTPUT}
src/cell.cpp
src/cell.h
src/common.h
src/formula.cpp
src/formula.h
src/FormulaAST.cpp
src/FormulaAST.h
src/sheet.cpp
src/sheet.h
src/structures.cpp
tests/main.cpp
tests/test_runner_p.h
)
target_link_libraries(unit-tests ${ANLTR_LIBRARY})