31 lines
868 B
CMake
31 lines
868 B
CMake
cmake_minimum_required(VERSION 3.26)
|
|
project(mcalc)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_STANDARD 23)
|
|
|
|
find_package(FLEX REQUIRED)
|
|
find_package(BISON REQUIRED)
|
|
|
|
add_subdirectory(external)
|
|
|
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/fb)
|
|
|
|
BISON_TARGET(parser src/parser.y ${CMAKE_CURRENT_BINARY_DIR}/fb/parser.cpp DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/fb/parser.h)
|
|
FLEX_TARGET(scanner src/tokens.l ${CMAKE_CURRENT_BINARY_DIR}/fb/lexer.cpp DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/fb/lexer.h)
|
|
ADD_FLEX_BISON_DEPENDENCY(scanner parser)
|
|
|
|
add_executable(mcalc
|
|
${BISON_parser_OUTPUTS}
|
|
${FLEX_scanner_OUTPUTS}
|
|
|
|
src/main.cpp
|
|
src/gui.cpp
|
|
src/state.cpp
|
|
src/mcalc.h
|
|
include/lexer_base.h
|
|
include/node.h
|
|
)
|
|
target_link_libraries(mcalc PRIVATE ext)
|
|
target_include_directories(mcalc PRIVATE include ${CMAKE_CURRENT_BINARY_DIR}/fb)
|