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) include_directories(/home/cl/onnx_run/onnxruntime-linux-x64-1.19.0/include) include_directories(/home/cl/onnx_run/abandoned_od/clip.cpp/ggml/include) link_directories(/home/cl/onnx_run/onnxruntime-linux-x64-1.19.0/lib) link_libraries(onnxruntime) 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(main main.cpp) message("find ${OpenCV_VERSION}") target_link_libraries(main ${OpenCV_LIBS}) target_link_libraries(main ${CUDA_LIBRARIES}) target_link_libraries(main nvinfer)