cmake_minimum_required(VERSION 3.21)
project(dora_zed_cpp LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "-fPIC")

include(DoraTargets.cmake)

set(ZED_DIR "/usr/local/zed" CACHE PATH "Path to the ZED SDK")
set(ZED_PATH ${ZED_DIR})
find_package(CUDAToolkit REQUIRED)
find_package(zed REQUIRED)

find_package(OpenCV REQUIRED)

link_directories(${dora_link_dirs})
link_directories(${ZED_LIBRARY_DIR})

add_executable(dora_zed_cpp main.cc ${node_bridge})
add_dependencies(dora_zed_cpp Dora_cxx)

target_include_directories(
    dora_zed_cpp
    PRIVATE
        ${dora_cxx_include_dir}
        ${dora_c_include_dir}
        ${ZED_INCLUDE_DIRS}
        ${OpenCV_INCLUDE_DIRS}
        ${CUDAToolkit_INCLUDE_DIRS}
)

target_link_libraries(dora_zed_cpp dora_node_api_cxx ${ZED_LIBRARIES} ${OpenCV_LIBS})

install(TARGETS dora_zed_cpp DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin)
