Parsodus/src/CMakeLists.txt

58 lines
1.6 KiB
CMake

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
if (NOT LEXESIS_EXE_FOUND)
add_custom_command(DEPENDS ext-lexesis "${CMAKE_CURRENT_SOURCE_DIR}/parsodusLexer.lxs"
COMMAND ${LEXESIS_EXE} ARGS -d "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/parsodusLexer.lxs"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ParsodusLexer.h" "${CMAKE_CURRENT_BINARY_DIR}/ParsodusLexer.cpp"
)
else()
add_custom_command(DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/parsodusLexer.lxs"
COMMAND ${LEXESIS_EXE} ARGS -d "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/parsodusLexer.lxs"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ParsodusLexer.h" "${CMAKE_CURRENT_BINARY_DIR}/ParsodusLexer.cpp"
)
endif()
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
add_library(Parsodus-util
util/firstset.cpp
util/followset.cpp
)
add_library(Parsodus-tables
lrtables/LR0Item.cpp
lrtables/LR0Itemset.cpp
lrtables/SLR1Itemset.cpp
lrtables/LR1Item.cpp
lrtables/LR1Itemset.cpp
lrtables/LALR1Itemset.cpp
)
# add_library(Parsodus-backends
# )
add_library(pds
backend.cpp
driver.cpp
template.cpp
inputparser.cpp
backendmanager.cpp
"${CMAKE_CURRENT_BINARY_DIR}/ParsodusLexer.cpp"
)
add_executable(Parsodus
main.cpp
)
target_link_libraries(Parsodus
Parsodus-util
Parsodus-tables
# Parsodus-backends
pds
mstch::mstch)
install(TARGETS Parsodus
RUNTIME DESTINATION bin
)