# PRC-09 coffee-shop ordering kiosk, built in steps. Each step is the whole
# program at that point in the walkthrough, and is built and tested on its own.
#   step-1  a menu with sizes and options, an order built line by line with
#           checks, prices in integer cents, and an in-memory order queue
#   step-2  change: time-boxed promotions, using an injected clock
set(prc_kiosk_sources_1 menu.cpp order.cpp order_queue.cpp)
set(prc_kiosk_sources_2 ${prc_kiosk_sources_1} promotion.cpp)
foreach(step IN ITEMS 1 2)
  list(TRANSFORM prc_kiosk_sources_${step} PREPEND step-${step}/ OUTPUT_VARIABLE sources)
  add_library(prc_kiosk_step${step} STATIC ${sources})
  target_include_directories(prc_kiosk_step${step} PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/step-${step})
  lld_add_test(prc_kiosk_step${step}_tests
    SOURCES step-${step}/tests/test_step${step}.cpp LABELS unit)
  target_link_libraries(prc_kiosk_step${step}_tests PRIVATE prc_kiosk_step${step})
  lld_add_example(prc_kiosk_step${step}_demo SOURCES step-${step}/main.cpp
    EXPECTED_OUTPUT step-${step}/expected_output.txt)
  target_link_libraries(prc_kiosk_step${step}_demo PRIVATE prc_kiosk_step${step})
endforeach()
