Parsodus/examples/json/CMakeLists.txt

20 lines
881 B
CMake

add_custom_command(DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/JSONLexer.lxs"
COMMAND "${LEXESIS_EXE}" ARGS -d "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/JSONLexer.lxs"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/JSONLexer.h" "${CMAKE_CURRENT_BINARY_DIR}/JSONLexer.cpp")
find_program(PARSODUS_EXE Parsodus PATH "${CMAKE_CURRENT_BINARY_DIR}/../../bin")
add_custom_command(DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/JSONParser.pds"
COMMAND "${PARSODUS_EXE}" ARGS -d "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/JSONParser.pds"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/JSONParser.h" "${CMAKE_CURRENT_BINARY_DIR}/JSONParser.cpp")
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
add_executable(json
EXCLUDE_FROM_ALL
json.cpp
main.cpp
parser.cpp
"${CMAKE_CURRENT_BINARY_DIR}/JSONLexer.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/JSONParser.cpp")