# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20)
project(state_based_monitoring CXX)

# Finds the package holoscan
find_package(holoscan REQUIRED CONFIG
             PATHS "/opt/nvidia/holoscan" "/workspace/holoscan-sdk/install")

add_executable(state_based_monitoring
  state_based_monitoring.cpp
)

target_link_libraries(state_based_monitoring
  PRIVATE
  holoscan::core
)

# Testing
if(BUILD_TESTING)
  add_test(NAME EXAMPLE_CPP_STATE_BASED_MONITORING_TEST
           COMMAND state_based_monitoring
           WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
          )
  set_tests_properties(EXAMPLE_CPP_STATE_BASED_MONITORING_TEST PROPERTIES
                       PASS_REGULAR_EXPRESSION "count is larger than 10. Finishing the dynamic flow"
                       FAIL_REGULAR_EXPRESSION "error"
                      )
endif()
