-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMake.txt
44 lines (33 loc) · 1.47 KB
/
CMake.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
cmake_minimum_required(VERSION 3.10)
project(application LANGUAGES CXX CUDA)
enable_language(CXX CUDA)
# Set OpenCV and ONNX Runtime directories
set(OpenCV_DIR /home/pc/libs/opencv-4.10.0/build)
set(ONNXRUNTIME_DIR /home/pc/libs/onnxruntime-linux-x64-gpu-1.19.2)
set(ONNXRUNTIME_LIBS ${ONNXRUNTIME_DIR}/lib/libonnxruntime.so)
set(ONNXRUNTIME_CUDA ${ONNXRUNTIME_DIR}/lib/libonnxruntime_providers_cuda.so)
set(ONNXRUNTIME_TENSORRT ${ONNXRUNTIME_DIR}/lib/libonnxruntime_providers_tensorrt.so)
set(ONNXRUNTIME_OPENVINO ${ONNXRUNTIME_DIR}/lib/libonnxruntime_providers_openvino.so)
set(OPENVINO_DIR /opt/intel/openvino_2024.4.0/runtime)
set(OPENVINO_LIBS ${OPENVINO_DIR}/lib/intel64)
# Find OpenCV
find_package(OpenCV REQUIRED)
find_package(CUDAToolkit)
# Manually specify ONNX Runtime include and library paths
include_directories(${ONNXRUNTIME_DIR}/include ${OPENVINO_DIR}/include)
link_directories(${ONNXRUNTIME_DIR}/lib ${OPENVINO_DIR}/lib ${OPENVINO_LIBS})
# Add your executable
add_executable(application tutorials/onnxruntime/ort-openvino.cpp)
# Link OpenCV and ONNX Runtime libraries
target_link_libraries(application
${OpenCV_LIBS}
${ONNXRUNTIME_LIBS}
${ONNXRUNTIME_CUDA}
${ONNXRUNTIME_TENSORRT}
${ONNXRUNTIME_OPENVINO}
${OPENVINO_LIBS}/libopenvino.so
${OPENVINO_LIBS}/libopenvino_onnx_frontend.so
${OPENVINO_LIBS}/libopenvino_paddle_frontend.so
${OPENVINO_LIBS}/libopenvino_pytorch_frontend.so
${OPENVINO_LIBS}/libopenvino_ir_frontend.so.2440
)