cmake_minimum_required(VERSION 3.0) project(testcv) set(OpenCV_DIR "~/lib/opencv4.10.0_install/lib/cmake/opencv4") #对应上面刚查的目录 include_directories(/home/cl/package/TensorRT-8.6.1.6/include) link_directories(/home/cl/package/TensorRT-8.6.1.6/lib) find_package(CUDA REQUIRED) include_directories(/usr/local/cuda-12.1/include) # link_directories(/usr/local/cuda-12.1/lib64) find_package(OpenCV 4.10 REQUIRED) message(STATUS "> include dir: ${OpenCV_INCLUDE_DIRS}") include_directories(${OpenCV_INCLUDE_DIRS}) add_executable(yolo-crowd yolov5_trt.cpp) message("find ${OpenCV_VERSION}") target_link_libraries(yolo-crowd ${OpenCV_LIBS}) target_link_libraries(yolo-crowd ${CUDA_LIBRARIES}) target_link_libraries(yolo-crowd nvinfer)