cmake_minimum_required(VERSION 3.0.0)
project(yolov8_ort CXX C)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pthread -g")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(ORT_DIR "/opt/dtk/onnxruntime")
message(STATUS "ONNXRUNTIME_DIR: ${ORT_DIR}")

find_package(OpenCV REQUIRED)
message(StATUS "OpenCV library status:")
message(STATUS "    version: ${OpenCV_VERSION}")
message(STATUS "    libraries: ${OpenCV_LIBS}")
message(STATUS "    include path: ${OpenCV_INCLUDE_DIRS}")

include_directories("include/")

add_executable(main
               src/utils.cpp
               src/yolov8Predictor.cpp
               src/main.cpp)


target_include_directories(main PRIVATE "${ORT_DIR}/include")

target_compile_features(main PRIVATE cxx_std_17)
target_link_libraries(main ${OpenCV_LIBS})
target_link_libraries(main "${ORT_DIR}/lib/libonnxruntime.so")