set(TensorRTSSD_DEPENDENCY_LIBS "")

include(cmake/Cuda.cmake)
if(NOT HAVE_CUDA)
  message(WARNING "Not compiling with CUDA support. Suppress this warning with -DUSE_CUDA=OFF.")
  set(USE_CUDA OFF)
endif()

#for dnn test
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_core.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_imgproc.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_imgcodecs.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_videoio.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_highgui.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_video.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_objdetect.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_photo.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_calib3d.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_dnn.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_stitching.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_features2d.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_flann.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_gapi.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_ml.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_aruco.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_phase_unwrapping.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_bgsegm.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_bioinspired.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_plot.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_ximgproc.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_quality.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_ccalib.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_reg.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_rgbd.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_datasets.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_saliency.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_dnn_objdetect.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_shape.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_stereo.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_dpm.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_face.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_structured_light.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_superres.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_surface_matching.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_fuzzy.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_text.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_tracking.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_hfs.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_img_hash.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_xfeatures2d.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_line_descriptor.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_xobjdetect.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_xphoto.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_videostab.so)
#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${OpenCV-ROOT}/libopencv_optflow.so)

LINK_LIBRARIES(libdl.so)
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_BINARY_DIR})
include_directories(/usr/include/opencv4)  # Change setting for other platforms in the future

INCLUDE_DIRECTORIES(PROJECT_BINARY_DIR)
INCLUDE_DIRECTORIES(${TensorRT-ROOT}/samples/common)
INCLUDE_DIRECTORIES(${TensorRT-ROOT}/include)
INCLUDE_DIRECTORIES(${CUDA_ROOT}/include)
#TensorRT

message(STATUS "TensorRT: " ${TensorRT-ROOT})

#list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${TensorRT-ROOT}/lib/libnvcaffeparser.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${TensorRT-LIB}/libnvcaffe_parser.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${TensorRT-LIB}/libnvinfer.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${TensorRT-LIB}/libnvinfer_plugin.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${TensorRT-LIB}/libnvonnxparser.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${TensorRT-LIB}/libnvonnxparser_runtime.so)
list(APPEND TensorRTSSD_DEPENDENCY_LIBS ${TensorRT-LIB}/libnvparsers.so)
