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

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

add_executable(for_loop_execution
  for_loop_execution.cpp
)

target_link_libraries(for_loop_execution
  PRIVATE
  holoscan::core
)

# Testing
if(BUILD_TESTING)
  add_test(NAME EXAMPLE_CPP_FOR_LOOP_EXECUTION_TEST
           COMMAND for_loop_execution
           WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
          )
  set_tests_properties(EXAMPLE_CPP_FOR_LOOP_EXECUTION_TEST PROPERTIES
                       PASS_REGULAR_EXPRESSION "I am here - node1 \\(index: -1\\).*I am here - node2.*I am here - node3.*I am here - node1 \\(index: [0-2]\\).*I am here - node4")
endif()
