CMakeLists.txt 971 B

123456789101112131415161718192021222324252627282930
  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. include_directories(/home/cl/onnx_run/onnxruntime-linux-x64-1.19.0/include)
  7. include_directories(/home/cl/onnx_run/abandoned_od/clip.cpp/ggml/include)
  8. link_directories(/home/cl/onnx_run/onnxruntime-linux-x64-1.19.0/lib)
  9. link_libraries(onnxruntime)
  10. find_package(CUDA REQUIRED)
  11. include_directories(/usr/local/cuda-12.1/include)
  12. # link_directories(/usr/local/cuda-12.1/lib64)
  13. find_package(OpenCV 4.10 REQUIRED)
  14. message(STATUS "> include dir: ${OpenCV_INCLUDE_DIRS}")
  15. include_directories(${OpenCV_INCLUDE_DIRS})
  16. add_executable(main main.cpp)
  17. message("find ${OpenCV_VERSION}")
  18. target_link_libraries(main ${OpenCV_LIBS})
  19. target_link_libraries(main ${CUDA_LIBRARIES})
  20. target_link_libraries(main nvinfer)