-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
52 lines (39 loc) · 1.91 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
cmake_minimum_required(VERSION 3.5)
project(Kompiler)
set(CMAKE_CXX_STANDARD 11)
FIND_PACKAGE(Boost REQUIRED COMPONENTS program_options system filesystem regex)
FIND_PACKAGE(GTest)
find_package(Protobuf REQUIRED)
IF (Boost_FOUND)
include_directories(${Boost_INCLUDE_DIR})
endif ()
IF (GTEST_LIBRARY)
include_directories(${GTEST_INCLUDE_DIR})
else ()
message("GTest was not found!")
endif ()
IF (Protobuf_FOUND)
include_directories(${Protobuf_INCLUDE_DIRS})
endif ()
set(Boost_USE_STATIC_LIBS OFF) # enable dynamic linking
set(CFG cfg.cpp cfg.h)
set(CFG_PARSER cfgparser.cpp cfgparser.h)
set(PARSER_MAIN parser_main.cpp ll1_parser.h machine.h)
set(MACHINE machine.cpp machine.h)
set(LEXER lexer.cpp lexer.h machine.h rexparser.h dfa.h trantable.h)
set(ERROR error.cpp error.h)
set(PARSE_TABLE parsetable.cpp parsetable.h)
set(PARSE_TABLE_PB parsetable.pb.cc parsetable.pb.h)
set(LL1_PARSER ll1_parser.cpp ll1_parser.h parsetable.h lexer.h)
set(SENTENTIAL_EXPRESSION sentential_expression.cpp sentential_expression.h)
set(LEFTMOST_DERIVATION leftmost_derivation.cpp leftmost_derivation.h error.h sentential_expression.h)
set(COMMAND_OPTIONS options/CustomOptionDescription.cpp options/CustomOptionDescription.hpp options/OptionPrinter.hpp
options/OptionPrinter.cpp)
add_executable(Kompiler ${CFG} parser_main.cpp ${CFG_PARSER} ${MACHINE} ${LEXER} ${ERROR} parsetable.pb.cc parsetable.pb.h ${PARSE_TABLE} ${LL1_PARSER}
${SENTENTIAL_EXPRESSION} ${LEFTMOST_DERIVATION} ${COMMAND_OPTIONS})
add_executable(Parser ${CFG} cfggen.cpp ${CFG_PARSER} ${MACHINE} ${LEXER} ${ERROR} parsetable.pb.cc parsetable.pb.h ${PARSE_TABLE} ${LL1_PARSER}
${SENTENTIAL_EXPRESSION} ${LEFTMOST_DERIVATION} ${COMMAND_OPTIONS})
target_link_libraries(Kompiler ${Boost_LIBRARIES})
target_link_libraries(Kompiler ${Protobuf_LIBRARIES})
target_link_libraries(Parser ${Boost_LIBRARIES})
target_link_libraries(Parser ${Protobuf_LIBRARIES})