CMakeLists.txt 752 B

123456789101112131415161718192021222324
  1. cmake_minimum_required(VERSION 3.0)
  2. project(testcv)
  3. set(OpenCV_DIR "~/lib/opencv4.10.0_install/lib/cmake/opencv4") #对应上面刚查的目录
  4. include_directories(/home/cl/package/TensorRT-8.6.1.6/include)
  5. link_directories(/home/cl/package/TensorRT-8.6.1.6/lib)
  6. find_package(CUDA REQUIRED)
  7. include_directories(/usr/local/cuda-12.1/include)
  8. # link_directories(/usr/local/cuda-12.1/lib64)
  9. find_package(OpenCV 4.10 REQUIRED)
  10. message(STATUS "> include dir: ${OpenCV_INCLUDE_DIRS}")
  11. include_directories(${OpenCV_INCLUDE_DIRS})
  12. add_executable(yolo-crowd yolov5_trt.cpp)
  13. message("find ${OpenCV_VERSION}")
  14. target_link_libraries(yolo-crowd ${OpenCV_LIBS})
  15. target_link_libraries(yolo-crowd ${CUDA_LIBRARIES})
  16. target_link_libraries(yolo-crowd nvinfer)