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

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

add_executable(streaming_execution
  streaming_execution.cpp
)

target_link_libraries(streaming_execution
  PRIVATE
  holoscan::core
)

# Testing
if(BUILD_TESTING)
  add_test(NAME EXAMPLE_CPP_STREAMING_EXECUTION_TEST
           COMMAND streaming_execution
           WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
          )
  set_tests_properties(EXAMPLE_CPP_STREAMING_EXECUTION_TEST PROPERTIES
                       PASS_REGULAR_EXPRESSION "node1 - Sending value 1.*#iteration: 1.*node2 - Received value 1.*node3 - Received value 1.*node4 - Received value 1.*node1 - Sending value [2-5].*#iteration: [2-5].*node2 - Received value [2-5].*node3 - Received value [2-5].*node4 - Received value [2-5].*node1 - Sending value 6.*#iteration: 6"
                      )
endif()
