# CS-01 parking lot, built in steps. Each step is the whole program at
# that point in the study, and is built and tested on its own.
#   step-1  spots, vehicle and spot compatibility, allocation
#   step-2  tickets, fee rules, payment through a stand-in, exit
#   step-3  change 1: several floors, and a floor can be closed
#   step-4  change 2: spots with electric chargers

add_library(cs_parking_step1 STATIC step-1/parking_lot.cpp)
target_include_directories(cs_parking_step1 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/step-1)
lld_add_test(cs_parking_step1_tests SOURCES step-1/tests/test_step1.cpp LABELS unit)
target_link_libraries(cs_parking_step1_tests PRIVATE cs_parking_step1)

foreach(step IN ITEMS 2 3 4)
  add_library(cs_parking_step${step} STATIC
    step-${step}/fees.cpp step-${step}/ticket.cpp step-${step}/parking_lot.cpp)
  target_include_directories(cs_parking_step${step} PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/step-${step})
  lld_add_test(cs_parking_step${step}_tests
    SOURCES step-${step}/tests/test_step${step}.cpp LABELS unit)
  target_link_libraries(cs_parking_step${step}_tests PRIVATE cs_parking_step${step})
endforeach()

# A demo for the first complete design and one for the final design.
foreach(step IN ITEMS 2 4)
  lld_add_example(cs_parking_step${step}_demo SOURCES step-${step}/main.cpp
    EXPECTED_OUTPUT step-${step}/expected_output.txt)
  target_link_libraries(cs_parking_step${step}_demo PRIVATE cs_parking_step${step})
endforeach()
