-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
56 lines (49 loc) · 1.92 KB
/
CMakeLists.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
45
46
47
48
49
50
51
52
53
54
55
56
cmake_minimum_required(VERSION 3.22)
project(FpsHelper)
set(CMAKE_CXX_STANDARD 20)
# import opencv library
find_package(OpenCV REQUIRED PATHS "E:/Library/OpenCV/build")
include_directories(${OpenCV_INCLUDE_DIRS})
# import onnxruntime library
find_package(OnnxRuntime REQUIRED PATHS "E:/Library/OnnxRuntime")
include_directories(${OnnxRuntime_INCLUDE_DIRS})
message(STATUS "OnnxRuntime version: ${OnnxRuntime_VERSION}")
# import tensorrt library
find_package(TensorRT REQUIRED PATHS "E:/Library/TensorRT")
include_directories(${TensorRT_INCLUDE_DIRS})
message(STATUS "TensorRT version: ${TensorRT_VERSION}")
# import cuda
set(CUDAToolkit_ROOT "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8")
find_package(CUDAToolkit REQUIRED)
include_directories(${CUDAToolkit_INCLUDE_DIRS})
message(STATUS "CUDAToolkit version: ${CUDAToolkit_VERSION}")
add_executable(FpsHelper
"src/capture/DXGICapture.cpp"
"src/capture/DXGICapture.h"
"src/inference/TRTInfer.cpp"
"src/inference/TRTInfer.h"
"src/core/pipeline.h"
"src/core/pipeline.cpp"
"src/paint/GDIPaint.cpp"
"src/paint/GDIPaint.h")
# CUDA::cudart
target_link_libraries(FpsHelper ${OpenCV_LIBS} ${TensorRT_LIBS} CUDA::cudart)
add_executable(captureTest
"src/capture/DXGICapture.cpp"
"src/capture/DXGICapture.h"
"src/test/captureTest.cpp")
target_link_libraries(captureTest ${OpenCV_LIBS})
add_executable(inferenceTest
"src/test/onnxTest.cpp"
"src/inference/OnnxInfer.cpp"
"src/inference/OnnxInfer.h")
target_link_libraries(inferenceTest ${OpenCV_LIBS} ${OnnxRuntime_LIBS})
add_executable(paintTest
"src/test/paintTest.cpp"
"src/paint/GDIPaint.cpp"
"src/paint/GDIPaint.h")
add_executable(trtTest
"src/inference/TrtInfer.cpp"
"src/inference/TrtInfer.h"
"src/test/trtTest.cpp")
target_link_libraries(trtTest ${OpenCV_LIBS} ${TensorRT_LIBS} CUDA::cudart)