# 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(streaming_with_monitor CXX)

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

add_executable(streaming_with_monitor
  streaming_with_monitor.cpp
)

target_link_libraries(streaming_with_monitor
  PRIVATE
  holoscan::core
)

# Testing
if(BUILD_TESTING)
  add_test(NAME EXAMPLE_CPP_STREAMING_WITH_MONITOR_TEST
           COMMAND streaming_with_monitor
           WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
          )
  set_tests_properties(EXAMPLE_CPP_STREAMING_WITH_MONITOR_TEST PROPERTIES
                       PASS_REGULAR_EXPRESSION "gen_signal - Sending value 1.*#iteration: 1.*visualize - Received value 1.*gen_signal - Sending value [2-5].*#iteration: [2-5].*visualize - Received value [2-5].*gen_signal - Sending value [6-9].*#iteration: [6-9].*visualize - Received value [6-9].*gen_signal - Sending value 10.*#iteration: 10.*visualize - Received value 10"
                      )
endif()
