# If subdirectory don't find packages
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
  cmake_minimum_required(VERSION 3.4 FATAL_ERROR)

  project(tof_cpp_examples CXX)

  # Find packages
  find_package(tof REQUIRED)
endif()

add_executable(capture_frames capture_frames.cpp)
target_link_libraries(capture_frames PRIVATE tof::tof)

add_executable(csf_camera csf_camera.cpp)
target_link_libraries(csf_camera PRIVATE tof::tof)

add_executable(detect_cameras detect_cameras.cpp)
target_link_libraries(detect_cameras PRIVATE tof::tof)

add_executable(error_handling error_handling.cpp)
target_link_libraries(error_handling PRIVATE tof::tof)

add_executable(transform transform.cpp)
target_link_libraries(transform PRIVATE tof::tof)

add_executable(manually_configure_camera manually_configure_camera.cpp)
target_link_libraries(manually_configure_camera PRIVATE tof::tof)

add_executable(static_scene_capture static_scene_capture.cpp)
target_link_libraries(static_scene_capture PRIVATE tof::tof)

add_executable(stream_frames stream_frames.cpp)
target_link_libraries(stream_frames PRIVATE tof::tof)

add_executable(test_frame_rate test_frame_rate.cpp)
target_link_libraries(test_frame_rate PRIVATE tof::tof)

add_executable(user_pointer user_pointer.cpp)
target_link_libraries(user_pointer PRIVATE tof::tof)

add_executable(modes modes.cpp)
target_link_libraries(modes PRIVATE tof::tof)
