-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathCMakeLists.txt
36 lines (29 loc) · 928 Bytes
/
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
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-deprecated-register")
project(simple_wc_example CXX)
cmake_minimum_required(VERSION 3.1)
find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
BISON_TARGET(mc_parser
mc_parser.yy
${CMAKE_CURRENT_BINARY_DIR}/mc_parser.tab.cc)
FLEX_TARGET(mc_lexer
mc_lexer.l
${CMAKE_CURRENT_BINARY_DIR}/mc_lexer.yy.cc)
ADD_FLEX_BISON_DEPENDENCY(mc_lexer mc_parser)
add_executable(my_wc
main.cpp
mc_driver.cpp
${FLEX_mc_lexer_OUTPUTS}
${BISON_mc_parser_OUTPUTS}
)
target_include_directories(my_wc
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${FLEX_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR})
set_property(TARGET my_wc
PROPERTY CXX_STANDARD 14)
enable_testing()
add_test(NAME basic
COMMAND ${CMAKE_SOURCE_DIR}/test/test0.pl
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})