# Builds every example of the SFWA NMPC guide against an installed copy of the library:
#
#   cmake -S nmpc-examples -B build-examples -DCMAKE_BUILD_TYPE=Release \
#     -DCMAKE_PREFIX_PATH=/path/to/nmpc/install
#   cmake --build build-examples
cmake_minimum_required(VERSION 3.20)
project(nmpc_guide_examples LANGUAGES CXX)

find_package(nmpc REQUIRED CONFIG)

foreach(example swingup linear check tune iteration horizon memory policy reference track correction)
    add_executable(${example} ${example}.cpp)
    target_link_libraries(${example} PRIVATE nmpc::nmpc)
endforeach()
